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
In [26]: series=pd.Series(range(10), pd.period_range(start='2000', periods=10, name='date', freq='M'))
In [25]: seriesOut[25]:
date2000-0102000-0212000-0322000-0432000-0542000-0652000-0762000-0872000-0982000-109Freq: M, dtype: int64In [30]: series.resample('M').first()
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
<ipython-input-30-4637af8f5d6f>in<module>()
---->1series.resample('M').first()
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/tseries/resample.pyinf(self, _method)
465466deff(self, _method=method):
-->467returnself._downsample(_method)
468f.__doc__=getattr(GroupBy, method).__doc__469setattr(Resampler, method, f)
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/tseries/resample.pyin_downsample(self, how, **kwargs)
709'resampled to {freq}'.format(
710axfreq=ax.freq,
-->711freq=self.freq))
712713def_upsample(self, method, limit=None):
ValueError: Frequency<MonthEnd>cannotberesampledto<MonthEnd># --> which is fair, even if I could imagine it returning itselfIn [31]: series.resample('M').pad()
---------------------------------------------------------------------------RecursionErrorTraceback (mostrecentcalllast)
<ipython-input-24-9df8c7209780>in<module>()
---->1series.resample('M').pad()
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/tseries/resample.pyinpad(self, limit)
393DataFrame.fillna394"""--> 395 return self._upsample('pad', limit=limit) 396 ffill = pad 397 /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/tseries/resample.py in _upsample(self, method, limit) 736 737 if not is_superperiod(ax.freq, self.freq):--> 738 return self.asfreq() 739 740 # Start vs. end of period/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/tseries/resample.py in asfreq(self) 435 essentially a reindex with (no filling) 436 """-->437returnself._upsample(None)
438439defstd(self, ddof=1):
# .............../Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/tseries/period.pyin_generate_range(cls, start, end, periods, freq, fields)
200raiseValueError('Can either instantiate from fields '201'or endpoints, but not both')
-->202subarr, freq=_get_ordinal_range(start, end, periods, freq)
203eliffield_count>0:
204subarr, freq=_range_from_fields(freq=freq, **fields)
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/tseries/period.pyin_get_ordinal_range(start, end, periods, freq, mult)
995996ifstartisnotNone:
-->997start=Period(start, freq)
998ifendisnotNone:
999end=Period(end, freq)
pandas/src/period.pyxinpandas._period.Period.__init__ (pandas/src/period.c:10867)()
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.pyin_find_and_load(name, import_)
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.pyin__enter__(self)
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.pyin_get_module_lock(name)
RecursionError: maximumrecursiondepthexceeded
Expected Output
Raise on the initial resample? Return itself? Deliberately raise on pad?
output of pd.show_versions()
18.0
The text was updated successfully, but these errors were encountered:
max-sixty
changed the title
BUG: Resample on existing freq causes recursion error
BUG: Resample pad on existing freq causes recursion error
Apr 1, 2016
max-sixty
changed the title
BUG: Resample pad on existing freq causes recursion error
ERR: Resample pad on existing freq causes recursion error
Apr 1, 2016
Not a big bug, but not ideal behavior:
Expected Output
Raise on the initial resample? Return itself? Deliberately raise on
pad
?output of
pd.show_versions()
18.0
The text was updated successfully, but these errors were encountered: