[Numpy-tickets] [NumPy] #897: Numpy mrecords - unpickle causes unhandled win32 exception
NumPy
numpy-tickets@scipy....
Wed Jan 7 17:04:48 CST 2009
#897: Numpy mrecords - unpickle causes unhandled win32 exception
-----------------------------+----------------------------------------------
Reporter: chrisshucksmith | Owner: pierregm
Type: defect | Status: assigned
Priority: normal | Milestone: 1.3.0
Component: numpy.ma | Version: none
Severity: major | Resolution:
Keywords: |
-----------------------------+----------------------------------------------
Changes (by pierregm):
* status: new => assigned
Comment:
OK, there's indeed something broken here, but I can't fix it for the
moment. Any array with some np.object in the dtype will fail, no matter
how simple the dtype is. Looks like the corresponding data should be
exported as a list instead of a string in __reduce__. Fixing this could be
problematic if there are several fields.
There's a workaround of some sorts, however:
1. use the `.torecords` (now called `.toflex`) method to transform the
MaskedArray into a ndarray with flexible dtype.
2. pickle the output.
3. use the `fromflex` function to get a masked_array from the unpickled
output.
--
Ticket URL: <http://scipy.org/scipy/numpy/ticket/897#comment:1>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list