This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author m.meliani
Recipients m.meliani
Date 2017-04-20.12:08:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492690132.67.0.227049528037.issue30116@psf.upfronthosting.co.za>
In-reply-to
Content
The few following lines, i believe, show how the numpy.ndarray.T or numpy.ndarray.transpose() don't change the structure of the data only the way they're displayed. Which is sometimes a problem when handling big quantities of data which you need to look at a certain way for sorting problems among others.

>>> import numpy as np
>>> x=np.array([[0,1,2],[1,2,3]])
>>> x=x.T
>>> print x
[[0 1]
 [1 2]
 [2 3]]
>>> y=np.array([[0,1],[1,2],[2,3]])
>>> print y
[[0 1]
 [1 2]
 [2 3]]
>>> y.view('i8,i8')
array([[(0, 1)],
       [(1, 2)],
       [(2, 3)]],
      dtype=[('f0', '<i8'), ('f1', '<i8')])
>>> x.view('i8,i8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: new type not compatible with array.
History
Date User Action Args
2017-04-20 12:08:52m.melianisetrecipients: + m.meliani
2017-04-20 12:08:52m.melianisetmessageid: <1492690132.67.0.227049528037.issue30116@psf.upfronthosting.co.za>
2017-04-20 12:08:52m.melianilinkissue30116 messages
2017-04-20 12:08:52m.melianicreate