question about datetime_unit of xarray.DataArray.differentiate #8000
-
I have a piece of data that looks like this
when i try to use xarray.DataArray.differentiate
Would you please told me is this a BUG? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think this is actually expected behavior despite what the documentation suggests. A We should update the documentation and potentially provide a nicer error message. |
Beta Was this translation helpful? Give feedback.
That's correct. The documentation is unfortunately misleading (#8006; thank you for bringing this to our attention!) and these options do not apply, in part for the reason you stated.
You could work around this by manually converting your time coordinate to have units of ordinal months since some reference date, though it will have a somewhat tenuous physical meaning. Consider the following example: