0

I am new to python and have learnt the basics. Tried to open a .csv file in my Jupyter Notebook but receiving an OSError when I run it. Tried entering the root address too but to no avail.

import pandas as pd
df = pd.read_csv("vgsales.csv")
df

ERROR : OSError Traceback (most recent call last) in 1 import pandas as pd ----> 2 df = pd.read_csv("vgsales.csv") 3 df OSError: Initializing from file failed

2

1 Answer 1

1

The solutions for this error may be

  1. Try to give the complete path name, which the directory where the file is present.
  2. Make sure that there is not space after the .csv extension
  3. Do not simply name the file with the extension .csv , we should convert the file to the .csv extension. Mostly in windows it will be in .xlsx extension.
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.