From: Ryan M. <rm...@gm...> - 2009-08-05 13:25:04
|
On Wed, Aug 5, 2009 at 7:11 AM, John Hunter <jd...@gm...> wrote: > >>> import matplotlib.mlab as mlab > >>> import matplotlib.cbook as cbook > >>> r = mlab.csv2rec( cbook.get_mpl_data('testdata.csv') ) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/Users/jdhunter/dev/lib/python2.6/site-packages/matplotlib/mlab.py", > line 2108, in csv2rec > fh = cbook.to_filehandle(fname) > File > "/Users/jdhunter/dev/lib/python2.6/site-packages/matplotlib/cbook.py", > line 339, in to_filehandle > raise ValueError('fname must be a string or file handle') > ValueError: fname must be a string or file handle > > Perhaps we could return a plain file handle pointing to the cached data? Another option is to use StringIO to create a new file-like object after read()-ing in all the data. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |