When I calculate the mean of data, when using data.mean(dim=["latitude", "longitude", "valid_time"]).item()
, the result is correct (~286K), while using data.mean().item()
, the result is much smaller (~95K), what’s wrong here?
I have tried to reset_coords
and drop_vars
to neglect the “expver” and “number”, but didn’t work …
The data is opened with xarray.open_dataset
, and has the format like:
<xarray.DataArray 't2m' (valid_time: 1021, latitude: 209, longitude: 421)> Size: 359MB
[89836769 values with dtype=float32]
Coordinates:
number int64 8B ...
valid_time (valid_time) datetime64[ns] 8kB 1940-01-01 ... 2025-01-01
latitude (latitude) float64 2kB 60.0 59.75 59.5 59.25 ... 8.5 8.25 8.0
longitude (longitude) float64 3kB 58.0 58.25 58.5 ... 162.5 162.8 163.0
expver (valid_time) <U4 16kB ...
Attributes: (12/32)
GRIB_paramId: 167
GRIB_dataType: an
GRIB_numberOfPoints: 1038240
GRIB_typeOfLevel: surface
GRIB_stepUnits: 1
GRIB_stepType: avgua
... ...
GRIB_totalNumber: 0
GRIB_units: K
long_name: 2 metre temperature
units: K
standard_name: unknown
GRIB_surface: 0.0