Re: [Numpy-discussion] 'Advanced' save and restore operation

2012-01-24 Thread Samuel John
I know you wrote that you want "TEXT" files, but never-the-less, I'd like to point to http://code.google.com/p/h5py/ . There are viewers for hdf5 and it is stable and widely used. Samuel On 24.01.2012, at 00:26, Emmanuel Mayssat wrote: > After having saved data, I need to know/remember the da

Re: [Numpy-discussion] 'Advanced' save and restore operation

2012-01-23 Thread Derek Homeier
On 24 Jan 2012, at 01:45, Olivier Delalleau wrote: > Note sure if there's a better way, but you can do it with some custom load > and save functions: > > >>> with open('f.txt', 'w') as f: > ... f.write(str(x.dtype) + '\n') > ... numpy.savetxt(f, x) > > >>> with open('f.txt') as f: > ...

Re: [Numpy-discussion] 'Advanced' save and restore operation

2012-01-23 Thread Olivier Delalleau
Note sure if there's a better way, but you can do it with some custom load and save functions: >>> with open('f.txt', 'w') as f: ... f.write(str(x.dtype) + '\n') ... numpy.savetxt(f, x) >>> with open('f.txt') as f: ... dtype = f.readline().strip() ... y = numpy.loadtxt(f).astype(d

[Numpy-discussion] 'Advanced' save and restore operation

2012-01-23 Thread Emmanuel Mayssat
After having saved data, I need to know/remember the data dtype to restore it correctly. Is there a way to save the dtype with the data? (I guess the header parameter of savedata could help, but they are only available in v2.0+ ) I would like to save several related structured array and a dictiona