[Numpy-discussion] Numpy save / load
Mon Jun 21 13:47:49 CDT 2010
On Mon, Jun 21, 2010 at 13:40, Vishal Rana <email@example.com> wrote:
> I have tried:
> r = np.core.records.fromarrays([x1,x2,x3],names='a,b,c'
Note, please do not reach down into numpy.core like this. Use
numpy.core.records is exposed as numpy.rec.
> type(r) gives <class 'numpy.core.records.recarray'>
> np.save('np.npy', r)
> r = np.load('np.npy')
> type(r) gives <type 'numpy.ndarray'>
> So my record is lost and converted to ndarray, any idea?
If you really need a recarray, then use r.view(numpy.rec.recarray).
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion