Error with Pandas Resampler - Should we remove it from tutorials so we can unfix the Pandas version?
co2_5kavg = co2_5k.mean() # the aggregator here is simply the mean
fig, ax = co2ts.plot(color='gray')
co2_5kavg.plot(ax=ax,color='C1')
Returns the following error:
ValueError Traceback (most recent call last)
Cell In[26], line 1
----> 1 co2_5kavg = co2_5k.mean() # the aggregator here is simply the mean
2 fig, ax = co2ts.plot(color='gray')
3 co2_5kavg.plot(ax=ax,color='C1')
File ~/Documents/GitHub/Pyleoclim_util/pyleoclim/core/series.py:4827, in SeriesResampler.getattr(self, attr)
4826 def getattr(self, attr):
-> 4827 attr = getattr(self.series.resample(self.rule, **self.kwargs), attr)
4828 def func(*args, **kwargs):
4829 series = attr(*args, **kwargs)
File ~/anaconda3/envs/pyleo/lib/python3.12/site-packages/pandas/core/generic.py:9834, in NDFrame.resample(self, rule, axis, closed, label, convention, kind, on, level, origin, offset, group_keys)
9831 else:
9832 kind = None
-> 9834 return get_resampler(
9835 cast("Series | DataFrame", self),
9836 freq=rule,
9837 label=label,
9838 closed=closed,
9839 axis=axis,
9840 kind=kind,
9841 convention=convention,
9842 key=on,
...
2320 labels = binner
File pandas/_libs/lib.pyx:907, in pandas._libs.lib.generate_bins_dt64()
ValueError: Values falls before first bin
Same error with: co2_5k.std().view()
Error with Pandas Resampler - Should we remove it from tutorials so we can unfix the Pandas version?
Returns the following error:
ValueError Traceback (most recent call last)
Cell In[26], line 1
----> 1 co2_5kavg = co2_5k.mean() # the aggregator here is simply the mean
2 fig, ax = co2ts.plot(color='gray')
3 co2_5kavg.plot(ax=ax,color='C1')
File ~/Documents/GitHub/Pyleoclim_util/pyleoclim/core/series.py:4827, in SeriesResampler.getattr(self, attr)
4826 def getattr(self, attr):
-> 4827 attr = getattr(self.series.resample(self.rule, **self.kwargs), attr)
4828 def func(*args, **kwargs):
4829 series = attr(*args, **kwargs)
File ~/anaconda3/envs/pyleo/lib/python3.12/site-packages/pandas/core/generic.py:9834, in NDFrame.resample(self, rule, axis, closed, label, convention, kind, on, level, origin, offset, group_keys)
9831 else:
9832 kind = None
-> 9834 return get_resampler(
9835 cast("Series | DataFrame", self),
9836 freq=rule,
9837 label=label,
9838 closed=closed,
9839 axis=axis,
9840 kind=kind,
9841 convention=convention,
9842 key=on,
...
2320 labels = binner
File pandas/_libs/lib.pyx:907, in pandas._libs.lib.generate_bins_dt64()
ValueError: Values falls before first bin
Same error with:
co2_5k.std().view()