Skip to content

Series.resample leads to RuntimeError: maximum recursion depth exceeded while calling a Python object #5026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cancan101 opened this issue Sep 28, 2013 · 1 comment
Milestone

Comments

@cancan101
Copy link
Contributor

rng = pd.date_range('1/1/2012', periods=4, freq=pd.offsets.YearEnd())
s = pd.Series(np.random.randn(4), index=rng)
s.resample(rule=pd.offsets.Week(weekday=0), fill_method="pad", closed="left", kind="period")

leads to:

...
/usr/local/lib/python2.7/dist-packages/pandas/tseries/period.pyc in _from_arraylike(cls, data, freq, tz)
    652                                       'inferred from first element'))
    653 
--> 654                 if np.issubdtype(data.dtype, np.datetime64):
    655                     data = dt64arr_to_periodarr(data, freq, tz)
    656                 elif data.dtype == np.int64:

/usr/local/lib/python2.7/dist-packages/numpy/core/numerictypes.pyc in issubdtype(arg1, arg2)
    757 
    758     """
--> 759     if issubclass_(arg2, generic):
    760         return issubclass(dtype(arg1).type, arg2)
    761     mro = dtype(arg2).type.mro()

/usr/local/lib/python2.7/dist-packages/numpy/core/numerictypes.pyc in issubclass_(arg1, arg2)
    697     """
    698     try:
--> 699         return issubclass(arg1, arg2)
    700     except TypeError:
    701         return False

Setting kind="period" seems to trigger the issue.

@cpcloud
Copy link
Member

cpcloud commented Sep 28, 2013

already have an issue for this #3612

@cpcloud cpcloud closed this as completed Sep 28, 2013
@ghost ghost assigned cpcloud Oct 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants