0

passing non-datetime values to matplotlib using xarrays. How to convert them in proper format.

I tried solving the issue with this answer xarray/datetime64[ns]: remove or normalise time from datetime but still the error continues.

The current format looks something like this:

ds.time.values[:5]

Output:

array(['1901-01-01T00:00:00.000000000', '1901-01-02T00:00:00.000000000',
       '1901-01-03T00:00:00.000000000', '1901-01-04T00:00:00.000000000',
       '1901-01-05T00:00:00.000000000'], dtype='datetime64[ns]')
Jatin Gharat
  • 41
  • 1
  • 10

1 Answers1

0

You should try date2num function from datetime library of python

Manmeet Singh
  • 405
  • 2
  • 11