[Numpy-discussion] Inconsistency in dtype.arrdescr?
Travis Oliphant
oliphant.travis at ieee.org
Mon Jan 16 12:08:01 EST 2006
Francesc Altet wrote:
>Hi,
>
>I find the next a bit misleading:
>
>
>>>>numpy.array((3,), dtype='u4').dtype.arrdescr
>>>>
>>>>
>[('', '<u4')]
>
>but...
>
>
>
>>>>numpy.zeros((3,), dtype='u4,u2').dtype.arrdescr
>>>>
>>>>
>[('f1', '<u4'), ('f2', '<u2')]
>
>I think it would be more consistent if the former expression would give
>as output:
>
>[('f1', '<u4')]
>
>
>
The problem is these are two separate circumstances. In the first case
you have no fields defined and so no field names. In the second case,
you have two fields which receive default field names.
-Travis
More information about the NumPy-Discussion
mailing list