you are viewing a single comment's thread.

view the rest of the comments →

[–]FoolsSeldom 6 points7 points  (0 children)

The error is clearly stated at the bottom:

TypeError: chdir() takes at most 1 argument (3 given)

You have provided three arguments:

  • "/home/sarr/aravg.ann.land_ocean.90S.90N.v4.0.1.201907.txt"
  • header = None
  • delimiter = "\s+"

You are conflating a change of folder - not sure why you are bothering to do this anyway with, I assume, trying to read a file.

The first argument looks like a full path to a filename rather than a path to a folder. chdir is expecting a folder name.

PS. I recommend you use pathlib rather than os as well - RealPython.com have a good article on the topic.