On my macbook air running OSX Mavericks (I'm almost certain this wasn't happening the other day on a PC running Windows 7 running virtually identical code) the following code gives me the following error.
import numpy as np
massFile='Users/BigD/Dropbox/PhD/PPMS/DATA/DB/HeatCap/HeatCapMass.txt'
print massFile
sampleInfo=np.genfromtxt(fname=massFile,skip_header=2,usecols=(2,3,4),dtype=float)
massfile is printed out as expected as 'Users/BigD/Dropbox/PhD/PPMS/DATA/DB/HeatCap/HeatCapMass.txt'
but I get the error
Traceback (most recent call last):
File "test.py", line 7, in <module>
sampleInfo=np.genfromtxt(fname=massFile,skip_header=2,usecols=(2,3,4),dtype=float)
File "//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py", line 1317, in genfromtxt
fhd = iter(np.lib._datasource.open(fname, 'rbU'))
File "//anaconda/lib/python2.7/site-packages/numpy/lib/_datasource.py", line 145, in open
return ds.open(path, mode)
File "//anaconda/lib/python2.7/site-packages/numpy/lib/_datasource.py", line 477, in open
return _file_openers[ext](found, mode=mode)
IOError: [Errno 2] No such file or directory: '/Users/BigD/Dropbox/PhD/PPMS/Users/BigD/Dropbox/PhD/PPMS/DATA/DB/HeatCap/HeatCapMass.txt'
it appears to be trying to be using half of the path and then adding the full path file to the end of it.
Does anyone know why this is happening or can suggest a work around?