0

i was trying to import a csv file(named as bostondatasets1.csv) in pandas using vscode .i checked & modified the syntax multiple times but the terminal is still showing error. it's showing that "No such file or directory"... can someone tell me why is this happening or what's wrong in syntax...coz it's working on other's system just not in my system.

i just want the csv file to import in my python scriptenter image description here

  • try this it will help to figure out the solution. https://stackoverflow.com/questions/57990772/cant-read-csv-files-using-pandas-in-visual-code – GirlCoder Dec 08 '22 at 15:40
  • _coz it's working on other's system just not in my system_ The other person has the csv file on their computer, but you don't. – John Gordon Dec 08 '22 at 18:47
  • Please do not use spaces in the file name, usually sampleProject or sample_ project. The problem should be that there is a space in front of the csv file in the path. – MingJie-MSFT Dec 09 '22 at 01:20

2 Answers2

0

I checked your screenshot .There is a little issue with the path that you are adding is space issue. your are giving space before bostonfile.csv ie sample

project/data anaylysis/ bostonfile.csv

just remove space before bostonfile.csv it will work

0

Try remove the spaces on your directory. Also try changing the format of your directory.

Bostondata = pd.read_csv(r"C:\directory\folder\location")

I was having issues with opening a file earlier and saw a few ways to work it out.

ClarkThark
  • 25
  • 7