I have a series of files named 0.nc, 1.nc, 2.nc, ... and am looking to use open_mfdataset to open them all at once, in order of filename. However, when I run the command:
labels = xarray.open_mfdataset('*.nc')
I get the error
ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation
I have tried adding a coordinate by:
for i in range(0,10):
labels = xarray.open_dataset(f'{i}.nc')
labels = labels.assign_coords({'name' : i})
labels.to_netcdf(f'.{i}_named.nc')
And then loading those files, but to no avail (same error).
What is a way I can load these files as one dataset where I dont encounter these errors?