I am very new to Python. I have to write a for loop. For example, there are 2 files, say "files". I need to extract the data from each. My codes are below, however, it keeps giving me the error:
list assignment index out of range.
I've searched for existing answers, but sorry I don't understand how to apply to my case. Many Thanks.
import xarray as xr
ds = []
for i in range(0,2):
ds[i] = xr.open_dataset(files[i])