I am looking to use datatable in Python to read in a csv using
df = dt.fread(r"C:\Users\Tom\Documents\Python\project 1\Data\train_2017.csv")
However, I am getting the error:
Unable to obtain size of C:\Users\Tony\Documents\Python\project 1\Data\train_2017.csv: [errno 2] No such file or directory
I am only able to import using the below alternative method:
import os
os.chdir('c:\\Users\\Tom\\Documents\\Python\\project 1\\Data')
train = dt.fread("train_2017.csv")
but the above is not practical as I have csvs outside of the project folder.
In R's data.table
I would do:
fread(file.choose())
Does datatable
in Python have the equivalent or what is the correct way of explicitly spelling out a csv's directory which is different to the working directory?
Thank you