try: x,y=np.loadtxt(f3,unpack=True) without the str().
On Fri, May 20, 2011 at 11:20 PM, uxv2g <amb...@cornell.edu> wrote: > > So, I installed EPD python for mac. From the terminal I go into a directory > where the file I'd like to read exists. In a python program I create a 2 > column data array and below I open it as "f3". The line in bold is that > referenced in the error. fwiw I'm just trying to do an easy x,y plot and > this is my first python attempt. > .... > f3=open(sys.argv[1]+ext, 'r') > > import matplotlib.pyplot as plt > import numpy as np > > x,y=np.loadtxt(str(f3),unpack=True) > > plotfile='sys.argv[1].png' > plt.plot(x,y) > plt.xtitle('step number') > plt.ytitle('energy') > plt.grid("off") > plt.output(plotfile,'png medium transparent picsize 600 400') > f3.close() > .... > ***error below&*** > File "SCFscript.py", line 40, in <module> > x,y=np.loadtxt(str(f3),unpack=True) > File > "/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/numpy/lib/npyio.py", > line 635, in loadtxt > fh = open(fname, 'U') > IOError: [Errno 2] No such file or directory: "<open file 'gq_1014.log.hy', > mode 'r' at 0x2a93e8>" > > ***** > The file exists, I checked. Where is it looking? In the python framework > directory above? Shouldn't it be opening the file from the current > directory? Am I missing something here? > > Thanks for any help!! > > > -- > View this message in context: > http://old.nabble.com/numpy.loadtxt-is-not-finding-an-existing-file.-What%27s-up--tp31668985p31668985.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ------------------------------------------------------------------------------ What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users