python - Numpy loadtxt file path name -
i wondering if had information on how load csv file using numpy's loadtxt. reason claims there no such file or directory, when there is. i've copy/pasted full path (with , without leading / root), no avail.
from numpy import * fh = loadtxt("/users/groenera/desktop/file.csv")
or
from numpy import * fh = loadtxt("users/groenera/desktop/file.csv")
thanks help. documentation loadtxt unhelpful (http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html).
this not loadtxt
problem. try simply
f = open("/users/groenera/desktop/file.csv")
to make sure loadtxt
's fault. also, try using unicode string:
f = open(u"/users/groenera/desktop/file.csv")
Comments
Post a Comment