Ok...I got it.
Sorry for stupid question.
On Thursday 09 October 2014 11:12 AM, suchith wrote:
> How to extract individual columns from a numpy array?
> For example, consider this script
>
> import numpy as np
> a = np.array([[1,2,3],[4,5,6],[7,8,9]])
> a[0][:]
> a[:][0]
>
How to extract individual columns from a numpy array?
For example, consider this script
import numpy as np
a = np.array([[1,2,3],[4,5,6],[7,8,9]])
a[0][:]
a[:][0]
Now both a[:][0] and a[0][:] are outputting the same result, i.e
np.array([1,2,3]). If I want to extract the array [[1],[4],[7]] the