[Numpy-discussion] Extracting individual columns in Numpy

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


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: numpy-problem.png
Type: image/png
Size: 100618 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141009/9dea669e/attachment.png>


More information about the NumPy-Discussion mailing list