[NumPy-Tickets] [NumPy] #1879: bug of numpy.ndarray.ndim
NumPy Trac
numpy-tickets@scipy....
Sat Jun 25 12:44:12 CDT 2011
#1879: bug of numpy.ndarray.ndim
------------------------+---------------------------------------------------
Reporter: coneagoe | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: numpy.core | Version: 1.6.0
Keywords: ndim dtype |
------------------------+---------------------------------------------------
1) It is OK, an array is created without argument ''dtype''. While
ndarray.ndim will be zero if the argument is specified.
{{{
>>> y = numpy.array([1, 2, 3])
>>> y
array([1, 2, 3])
>>> y.ndim
1
>>> y = numpy.array((1, 2, 3), dtype = [('a', numpy.int), ('b',
numpy.int), ('c', numpy.int)])
>>> y
array((1, 2, 3),
dtype=[('a', '<i4'), ('b', '<i4'), ('c', '<i4')])
>>> y.ndim
0
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1879>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list