Hi everyone,
I just stumbled on a behavior in NumPy for which I can't find an
explanation in the documentation. I wonder whether this is a bug or an
undocumented (or badly documented) feature:
--------------------------------------------------------------------------------------
import numpy
t = numpy.dtype([("rotation", numpy.float64, (3, 3)),
("translation", numpy.float64, (3,))])
# works
a1 = numpy.array([], dtype=t)
# doesn't work
a2 = numpy.array((), dtype=t)
# -> ValueError: size of tuple must match number of fields.
--------------------------------------------------------------------------------------
According to my understanding of how numpy.array should work, it
shouldn't make a difference if the first argument is a list or a
tuple, but in this case there is a difference.
Konrad.
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion