0

as u can cleary see in this picture

enter image description here

i have my txt file 'sunplots' in the same ordner as my python file 'test'.

If i open the python file 'test' and enter the following code:

from pylab import *
from numpy import *

data = loadtxt("sunspots.txt")

i always get an error

enter image description here

enter image description here

The error states there is no sunplots.txt file but how can this be? Both files are in the same folder, therefore i dont need to write the exact path and i did not write the txt file names wrong...

Heißenberg93
  • 1,829
  • 3
  • 11
  • 10
  • did you tried, restarting your kernal and run the code again? – vb_rises Oct 08 '19 at 16:04
  • 1
    the working directory is not necessarily the location of the notebook - debug with eg `import os` & `print(os.getcwd())` See also https://stackoverflow.com/questions/15680463/change-ipython-jupyter-notebook-working-directory – 9bO3av5fw5 Oct 08 '19 at 16:24
  • @ vb_rises yes but i did not work out. @9bO3... thx for that command it worked ! – Heißenberg93 Oct 09 '19 at 08:28

0 Answers0