0

I am having a problem, where python cant seem to find to find t file that is in the same folder as the Jupiter notebook. I have tried copying the whole address, but it doesn't work. I have recently switched computer, where it worked on the old computer, but on the new it doesn't work. I get the following error message:

KeyError: [<class 'netCDF4._netCDF4.Dataset'>, ('c:\\Users\\rasmu\\OneDrive\\Skrivebord\\1 Python fysik\\3. år\\PUK\\Dataset.nc',), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), '3c8f0647-26f8-41da-8245-aec6e4ddd30c']

and

FileNotFoundError: [Errno 2] No such file or directory: 'c:\\Users\\rasmu\\OneDrive\\Skrivebord\\1 Python fysik\\3. år\\PUK\\Dataset.nc'

I only have this line of code:

    data = xr.open_dataset('Dataset.nc')
4
  • Problem solved, for some reason it couldn't handle a å in this computer Commented Jun 26 at 13:12
  • Interesting! What operating system?
    – Joooeey
    Commented Jun 26 at 13:17
  • maybe explicitly enabling UTF-8 support helps, as described here for instance. Commented Jun 27 at 10:49
  • Operating system is windows 11. However i believe the problem is because i have set my language to english, which before was in danish Commented Jun 28 at 11:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.