0

I basically had only 1 line of code, that is:

data = pd.read_excel('Physical properties.xlsx', index_col=1, header=3)

this line works if it was in ipynb format, but produces [Errno 2] No such file or directory error if was run in py format. Both file exist in the same folder as the excel file, both has the exact same code (because I copy-pasted it). It does work if I put it as r'directory', but I'm wondering why it didnt work as just namefile.xlsx

It does work if I put it as r'directory', but I'm wondering why it didnt work as just namefile.xlsx

  • How are you running the .py file? At command line with `python` interpreter and in what directory? Or via an IDE like Spyder, PyCharm, etc.? Tag and title indicates VisualStudio. Don't assume current working directory. Better to be explicit with full path. – Parfait Sep 02 '23 at 15:55

0 Answers0