[Numpy-discussion] What's wrong with floatint.c example code?

Ralph Heinkel ralph at dont-mind.de
Thu Feb 26 13:42:44 EST 2009


Hi,

I'm trying to get into the realm of implementing my own numpy data
types in numpy, and doing so I had a look at the floatint.c example
coming from the numpy/doc/newdtype_example directory.

Obviously it is not possible to create an array with the new floatint
type by doing

array([1,2,3,4,5,6,7,8], dtype=floatint)

but instead this works:

array([1,2,3,4,5,6,7,8]).view(ff.floatint_type)

Would anybody mind helping me to understand this behavior? Is the
reason for this that the floatint.c stuff is incomplete and would need
some more elaboration in order to function as a proper type?

Thanks in advance

Ralph




More information about the NumPy-Discussion mailing list