1

I am currently struggling to import an excel-csv file to python. I'm sure my problem is very easy to solve, but I'm quite new to programming in python.

The code I used:

train1 = pd.read_csv(r"D:\Foldername1\Foldername2\data.csv") 

Then I get this kind of error:

  File "pandas\_libs\parsers.pyx", line 697, in pandas._libs.parsers.TextReader._setup_parser_source

OSError: Initializing from file failed

I thought about the need to add something like sep=',' but this didn't work either. So I'm kinda helpless at the moment. Thank you very much already! :)

1

1 Answer 1

0

try this,

train1 = pd.read_csv(r"D:\Foldername1\Foldername2\data.csv", engine='python') 

If raises Permission denied, then give read permission to your file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.