[Numpy-discussion] 1.1.1rc1 to be tagged tonight

Stéfan van der Walt stefan@sun.ac...
Tue Jul 22 10:18:25 CDT 2008


2008/7/22 Charles R Harris <charlesr.harris@gmail.com>:
>> That's easy to fix.  New patch attached.
>
> Yep, but I wanted you to look it over and find all the problems ;)

Ah, you have your managerial hat on!

> Could you post a patch against current mainline svn, which already has your
> previous patch applied? I'm also curious why we need tuples, are we using
> these values as hashes someplace.

Applied.  The reason we need to use tuples is because

In [3]: np.array([[1, 2], [3, 4]], dtype=[('x', int), ('y', int)])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/Users/stefan/<ipython console> in <module>()

TypeError: expected a readable buffer object

but

In [4]: np.array([(1, 2), (3, 4)], dtype=[('x', int), ('y', int)])
Out[4]:
array([(1, 2), (3, 4)],
      dtype=[('x', '<i4'), ('y', '<i4')])

Regards
Stéfan


More information about the Numpy-discussion mailing list