Cant read csv files using pandas in Visual Code Cant read csv files using pandas in Visual Code pandas pandas

Cant read csv files using pandas in Visual Code


I think it is easier to always give the total file path.

Instead of:

test= pd.read_csv('test.csv', encoding='utf-8')

try to use:

test = pd.read_csv('C:/users/anubhav.jhalani/downloads/ex_files_building_deep_learning_apps/test.csv', endcoding='utf-8')

this should help, you can also have a look here, what syntax you need to write it:Windows path in Python

You can also get the full path in your windows explorer, if you are unsure where it is saved.


In my case it also wasn't able to find the file even in the same directory and with the complete path. I figured it out that this issue was happening only in my VSCode editor and when I opened the same notebook in jupyter lab it was perfectly working. So then I tried one thing that make it work for me in VSCode as well was that I put my file in the directory other than "C". For example I put my file in the "D" directory and in VSCode it becomes able to work fine.