You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by jesieleo July 19, 2023
I have a piece of data that looks like this
<xarray.Dataset>
Dimensions: (time: 612, LEV: 15, latitude: 20, longitude: 357)
Coordinates:
* time (time) datetime64[ns] 1960-01-15 1960-02-15 ... 2010-12-15
* LEV (LEV) float64 5.01 15.07 25.28 35.76 ... 149.0 171.4 197.8 229.5
* latitude (latitude) float64 -4.75 -4.25 -3.75 -3.25 ... 3.75 4.25 4.75
* longitude (longitude) float64 114.2 114.8 115.2 115.8 ... 291.2 291.8 292.2
Data variables:
u (time, LEV, latitude, longitude) float32 ...
Attributes: (12/30)
cdm_data_type: Grid
Conventions: COARDS, CF-1.6, ACDD-1.3
creator_email: [email protected]
creator_name: APDRC
creator_type: institution
creator_url: https://www.atmos.umd.edu/~ocean/
... ...
standard_name_vocabulary: CF Standard Name Table v29
summary: Simple Ocean Data Assimilation (SODA) soda po...
time_coverage_end: 2010-12-15T00:00:00Z
time_coverage_start: 1983-01-15T00:00:00Z
title: SODA soda pop2.2.4 [TIME][LEV][LAT][LON]
Westernmost_Easting: 118.25
when i try to use xarray.DataArray.differentiate data.u.differentiate('time',datetime_unit='M')
will appear
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Anaconda3\lib\site-packages\xarray\core\dataarray.py", line 3609, in differentiate
ds = self._to_temp_dataset().differentiate(coord, edge_order, datetime_unit)
File "D:\Anaconda3\lib\site-packages\xarray\core\dataset.py", line 6372, in differentiate
coord_var = coord_var._to_numeric(datetime_unit=datetime_unit)
File "D:\Anaconda3\lib\site-packages\xarray\core\variable.py", line 2428, in _to_numeric
numeric_array = duck_array_ops.datetime_to_numeric(
File "D:\Anaconda3\lib\site-packages\xarray\core\duck_array_ops.py", line 466, in datetime_to_numeric
array = array / np.timedelta64(1, datetime_unit)
TypeError: Cannot get a common metadata divisor for Numpy datatime metadata [ns] and [M] because they have incompatible nonlinear base time units.
Would you please told me is this a BUG?
The text was updated successfully, but these errors were encountered:
Should say that
Y
andM
cannot be supported withdatetime64
Discussed in #8000
Originally posted by jesieleo July 19, 2023
I have a piece of data that looks like this
when i try to use xarray.DataArray.differentiate
data.u.differentiate('time',datetime_unit='M')
will appear
Would you please told me is this a BUG?
The text was updated successfully, but these errors were encountered: