I can easily read a csv file if I go:
pd.read_csv(r'C:\\yourpath\yourcsvfile.csv')
But I wanna try path variables instead of hardcode my path. So I tried:
processed_data_path=os.path.join(os.path.pardir,'data','processed')
train_file_path=os.path.abspath(os.path.join(processed_data_path,'train.csv'))
test_file_path=os.path.abspath(os.path.join(processed_data_path,'test.csv'))
the print result is:
C:\yourpath\train.csv
C:\yourpath\test.csv
So it looks alright. But when I tried the code below it throws a file does not exist error:
train_df = pd.read_csv(train_file_path)
where is the problem?