[Numpy-discussion] Extracting individual columns in Numpy

suchith suchithjn22 at gmail.com
Thu Oct 9 01:59:59 EDT 2014


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]
>
> 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]] then 
> what should I do? Is it possible to add this feature? If so, which 
> file(s) should I edit?
>
> I know C,C++ and Python programming and I am new to open-source 
> software development. Please help me.
>
> I have attached the screenshot with this mail.
>
> Thanks
> Suchith.J.N
>




More information about the NumPy-Discussion mailing list