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
This is more of a usage question so apologies if this is the incorrect place to ask this. I'm trying to plot some xarray data but am running into issues with dates that have custom 'days since x' units, e.g. adapting the example from the README this code errors for me:
import random
import matplotlib.pyplot as plt
import xarray as xr
import nc_time_axis
import cftime
dates = xr.cftime_range(start='0001', periods=24, freq='MS', calendar='noleap')
c_d_time = [nc_time_axis.CalendarDateTime(item, "noleap") for item in dates]
temperatures = [round(random.uniform(0, 12), 3) for _ in range(len(c_d_time))]
plt.plot(c_d_time, temperatures)
plt.margins(0.1)
plt.ylim(0, 12)
plt.xlabel("Date")
plt.ylabel("Temperature")
plt.show()
ValueError: invalid year provided in cftime.DatetimeNoLeap(0, 10, 23, 2, 24, 0, 8, 3, 296)
Apologies if I've missed something obvious but I would appreciate a pointer on how to deal with dates like this.
The text was updated successfully, but these errors were encountered:
This is more of a usage question so apologies if this is the incorrect place to ask this. I'm trying to plot some xarray data but am running into issues with dates that have custom 'days since x' units, e.g. adapting the example from the README this code errors for me:
Apologies if I've missed something obvious but I would appreciate a pointer on how to deal with dates like this.
The text was updated successfully, but these errors were encountered: