0

I have a csv file in the same directory with py file If i read it this way :

heart_data = pd.read_csv(r'C:\Python\heart_disease_data.csv') It works without any problem. but this way : heart_data = pd.read_csv(r'heart_disease_data.csv') It doesn't work, even though it's in the same directory.

I get this message in streamlit : FileNotFoundError: [Errno 2] No such file or directory: 'heart_disease_data.csv'

any thoughts ?

Jamiu S.
  • 5,257
  • 5
  • 12
  • 34
  • Is it possible that you misspelled it? – Guy zvi Aug 18 '22 at 07:14
  • Check `import os;os.listdir(os.curdir)` and make sure your CSV file exists within the current directory. – J. Choi Aug 18 '22 at 07:17
  • I assume "even though it is in the same directory" means "the same directory as the script". If you genuinely have trouble opening a file in your current working directory, please [edit] to clarify (and ping me to get this reopened, provided you have added enough details to show us that the file is really there and that it still doesn't work). – tripleee Aug 18 '22 at 08:54

0 Answers0