I have an array looks like this (two dimensions):
[[1.]
[1.]
[1.]
[1.]
[1.]
[1.]
[1.]
[0.]
[0.]
[1.]
[1.]
[1.]
[1.]
[1.]
[1.]
[1.]
[1.]
[1.]
[0.]
[1.]
[1.]
[1.]
[1.]
[0.]
[1.]]
How can I change it to: [1 1 1 1 ............1 0 1]
I've been looking for solution for a whole afternoon but still got no idea, can someone give me some hint, thanks.
On a numpy array a:
np.squeeze(a)
or
a.flatten()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With