ValueError: Every dimension needs a coordinate for inferring concatenation order

I’m really new to python and especially to xarray so any help would be really appreciated. I have several nc files that look at few variables over different time periods. I’m trying to open all of them along the time dimension, so it’s just one long dataset that goes from time(0) to time(end) but I can’t figure out why open_mfdataset isn’t working.

My files look like this (they’re all the same except for time):

Dimensions: a: 6000, b: 600, c: 10, d: 11, e: 1500, f: 2, g: 7, time: 24 Coordinates: lat (a): … long (a): … depth ©: … xe (b): … ye (b): … ze (d): … a (a): … time (time): …

Data variables: (there are heaps of these but I only care about what happens to these ones) Area: (a):… depth: ©:… temp: (time,a,b): … eta: (time,a): …

I’ve tried it a few different ways, but this is the one that makes the most sense to me.

xr.open_mfdataset('path/to/file/*.nc',concat_dim='time',data_vars='minimal',coords='minimal')

Except I’m still getting this error:

ValueError: Every dimension needs a coordinate for inferring concatenation order

And I don’t know why. Surely by choosing time as the concat_dim that tells it what to concatenate along? Is there something else I can try?

Hi @elenaflorence,

In which course and lecture are you? I’m asking because this is the Unity subforum.

This topic was automatically closed after 4 hours. New replies are no longer allowed.

Privacy & Terms