I was perfectly able to use pandas read_csv
for reading files in Windows. However I cannot figure out how to set local path in Ubuntu?
If I do this:
data = pd.read_csv(r'file://home/gosper/Desktop/test.csv')
... it throws the error: URLError: <urlopen error [Errno 2] No such file or directory
this should work for Windows's and UNIX's Desktop folder:
data = pd.read_csv(os.path.expanduser('~') + '/Desktop/test.csv')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With