[issue30116] numpy.ndarray.T doesn't change the structure

2017-04-20 Thread R. David Murray

R. David Murray added the comment:

Numpy is not part of the Python standard library.  You'll need to engage with 
the numpy community on this question.  (I say engage with them on the question, 
not report a bug to them, because I highly doubt this is a bug...there's 
probably some way to do what you want, so I suggest asking a question first 
rather than reporting a bug).

--
nosy: +r.david.murray
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30116] numpy.ndarray.T doesn't change the structure

2017-04-20 Thread m.meliani

New submission from m.meliani:

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', '>> x.view('i8,i8')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: new type not compatible with array.

--
messages: 291967
nosy: m.meliani
priority: normal
severity: normal
status: open
title: numpy.ndarray.T doesn't change the structure
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com