When i run the script this error is raised. But, the files are in this directory, i tried multiple ways to find these files.
I tried the
os.path.join("mydir", "myfile")
method. But the file was not found.
So i searched a little and tried this, but with no results:
with open (os.path.join("database", "weather_data.csv")) as file:
csv_database = pd.read_csv(file)
The file structure:
enter image description here
How i fix that?
2
Answers
That was a weird bug on my vscode. I just refresh the explorer on my vscode and the code works fine.
Verify your File Path once again.
Then Check your .Current Working Directory.
import os
print("Current Working Directory:", os.getcwd())
Refresh the VSCode Explorer