TIME IN XARRAY

Jorge Conforte jorge.conforte at inpe.br
Thu Apr 15 13:58:35 EDT 2021



Hi,


I'm using xarray to read netcdf data and I had to time in my data the 
values:


xarray.DataArray 'time' (time: 507)>
array(['1979-01-01T00:00:00.000000000', '1979-02-01T00:00:00.000000000',
        '1979-03-01T00:00:00.000000000', ..., 
'2021-01-01T00:00:00.000000000',
        '2021-02-01T00:00:00.000000000', '2021-03-01T00:00:00.000000000'],
       dtype='datetime64[ns]')


Please, how can I get the years and months values from this array.


Thanks,


Conrado



More information about the Python-list mailing list