Question for everyone, is this really reasonable:

>>> import numpy as np
>>> from operator import index
>>> index(np.array([[5]]))
5
>>> int(np.array([[5]]))
5
>>> [0,1,2,3][np.array([[2]])]
2

To me, this does not make sense, why should we allow to use a high
dimensional object like a normal scalar (its ok for 0-d arrays I guess)?
Personally I would be for deprecating these usages, even if that
(probably) means you cannot reshape your array with a matrix (as it is
2D) ;-):
>>> np.arange(10).reshape(np.matrix([5,-1]).T)
array([[0, 1],
       [2, 3],
       [4, 5],
       [6, 7],
       [8, 9]])

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to