[NumPy-Tickets] [NumPy] #952: Pickling an element of a recarray is silently broken
NumPy Trac
numpy-tickets@scipy....
Wed May 5 15:29:59 CDT 2010
#952: Pickling an element of a recarray is silently broken
------------------------+---------------------------------------------------
Reporter: philbinj | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: numpy.core | Version: devel
Keywords: |
------------------------+---------------------------------------------------
Changes (by bluesquall):
* version: none => devel
Comment:
This bug still exists in numpy 2.0.0.dev8372
I have no idea how to fix it, but I came across another clue. Apparently
the issue is unique to indexing or slicing across records but not along
records.
WHAT STEPS REPRODUCE?
{{{
In [1]: import numpy as np; np.__version__
Out[1]: '2.0.0.dev8372'
In [2]: dtype = [('r',np.float),('g',np.float),('b',np.float)]
In [3]: a = np.ones(2,dtype=dtype); a
Out[3]:
array([(1.0, 1.0, 1.0), (1.0, 1.0, 1.0)],
dtype=[('r', '<f8'), ('g', '<f8'), ('b', '<f8')])
In [4]: ar = a.view(np.recarray); ar
Out[4]:
rec.array([(1.0, 1.0, 1.0), (1.0, 1.0, 1.0)],
dtype=[('r', '<f8'), ('g', '<f8'), ('b', '<f8')])
In [5]: np.loads(ar['g'].dumps())
Out[5]: array([ 1., 1.])
In [6]: np.loads(ar.g.dumps())
Out[6]: array([ 1., 1.])
In [7]: np.loads(ar[0].dumps())
Out[7]: (3.1502165757027449e-267, 4.7429364523866899e-309,
1.0882549075156349e+175)
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/952#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list