Day of month in xarray

342 views Asked by At

I have dataset data and I found anomaly so the result was data array with coordinates (longitude, latitude) and time and the time as number of year.

How to change the Time as 1 June , 2 June... so far?

screenshot of xarray.DataArray

1

There are 1 answers

2
Joran Beasley On

i think you could just do

pandas.to_datetime(x['time'],origin=datetime.datetime(2020,1,1),unit="D")

(this assumes the int is day number of this year and jan 1 == 0)