On Thursday 04 January 2007 06:13, Sven Schreiber wrote: > belinda thom schrieb: > > A tangential question; recently I was looking for a way to save/load > > numeric data (often so it could be used later for building plots). I > > found load/save better documented than numpy's to/fromfile, so used > > that. The question, from the responsibility point of view, however, > > is where I should be going to get this functionality. Are both > > equally "stable"? Also, since numpy borrows from matlab, I was > > surprised that load/save is only provided via matplotlib's mlab.py > > (its not in numpy's matlib.py). > > Maybe you know that already, but in scipy there is something like > scipy.io.read_array and write_array which is very similiar to mpl's > load/save (IIRC). > > IMHO something like that would be a welcome addition to numpy, but I > have learned that adding features to numpy is quite controversial... > (oh, we're on the mpl list right now, ok) > > In the end I wrote my own csv read and write functions (see post in > other thread), because I didn't see why my code should depend on having > scipy or mpl installed just because of 20 or 30 lines of code. > > (AFAIK numpy fromfile and tofile are for binary data, not text files. > Don't know if you want that.)
You can use numpy's tofile and fromfile for text files, you just have to add a delimiter kwarg. However, fromfile only returns 1D arrays. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users