Unable to understand file path setting while programming in jupyter notebook

Asked 2 years ago, Updated 2 years ago, 83 views

As shown in the shot below, an error appears when jupyter writes a file read into the program and executes it.Please tell me where to put the file or how to set the path to the file.I'm a beginner in the program.
Enter a description of the image here

python jupyter-notebook

2022-09-30 19:37

1 Answers

It's not limited to jupyter notebook, but the current directory will be displayed with the following command, so you can store the file there.

importos
os.getcwd()

For jupyter notebook, 'C:\Users\Username' is the default.

You can also change it with the following command:

jupyter notebook --notebook-dir=<directory>


2022-09-30 19:37

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.