0

I am having difficulty extracting data from a file using os.chdir, I am using Datalore. But I get a similar error on VSCode, Jupiter Notebook as well.

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline 
import warnings
warnings.filterwarnings('ignore') #don't display warnings
import os
os.chdir("NEON_D02_SERC_DP3_368000_4306000_reflectance.h5")
import neon_aop_hyperspectral as neon_hs
sercRefl, sercRefl_md = neon_hs.aop_h5refl2array("neon_aop_hyperspectral.py")

I did not put the full path because I uploaded the necessary files to the Datalore environment and when I click on copy file path it copies these ones between "". On Jupiter, I tried to copy the full path on the local machine, the same as VSCode, but all of them gave me errors. Here is the error I get.

"Traceback (most recent call last): at block 1, line 7 NotADirectoryError: [Errno 20] Not a directory: 'NEON_D02_SERC_DP3_368000_4306000_reflectance.h5'"

What is the reason for this and why it is so complicated?

devnewdevv
  • 23
  • 5

0 Answers0