[NumPy-Tickets] [NumPy] #1505: load() yields corrupted/incorrect data
NumPy Trac
numpy-tickets@scipy....
Wed Jan 25 13:26:01 CST 2012
#1505: load() yields corrupted/incorrect data
-------------------------+--------------------------------------------------
Reporter: RRosario | Owner: somebody
Type: defect | Status: closed
Priority: high | Milestone: 1.6.0
Component: numpy.core | Version: 1.4.0
Resolution: worksforme | Keywords: load save corrupt inconsistent
-------------------------+--------------------------------------------------
Comment(by andreh):
Replying to [comment:6 andreh]:
> I discovered a similar problem with coo_matrix : {{{shape}}} is not the
same after serialization .
>
> Replying to [comment:3 pv]:
> > Works for me.
> > {{{
> > >>> import numpy as np
> > >>> import scipy.sparse as sparse
> > >>> x = sparse.lil_matrix((395000,395000))
> > >>> x[:,10] = 1
> > >>> x[10,:] = 1
> > >>> x = x.tocsc()
> > >>> np.save('dump.npy', x.indices)
> > >>> y = np.load('dump.npy')
> > >>> np.allclose(x.indices, y)
> > True
> > }}}
>
More information:
{{{
x.__class__
}}}
is
{{{
<class 'scipy.sparse.csc.csc_matrix'>
}}}
while
{{{
y.__class__
}}}
is
{{{
<type 'numpy.ndarray'>
}}}
i.e. the class is altered by serialization/serialization.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1505#comment:7>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list