datasets/file.csv
source/code.ipynb
from within i want to access the file named file.csv.
import pandas as pd
data = pd.read_csv("../datasets/file.csv")
This is giving me the error : ParserError: Error tokenizing data. C error: Expected 1 fields in line 68, saw 2
How to access file using relative path in pandas python? I am using Python3.6 with Anaconda in Windows 8.1 with Jupyter notebook.
The ParseError indicates that your error is in parsing the file, not locating and opening it. To verify this, try:
test_file = open('../datasets/file.csv')
for line in test_file:
print(line.strip())
This should print out the lines in file.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