Skip to content

BinGrouper AttributeError when returning a Series from DataFrame.apply #2300

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
dalejung opened this issue Nov 20, 2012 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@dalejung
Copy link
Contributor

http://nbviewer.ipython.org/4118124/

import pandas as pd
from pandas.tseries.resample import TimeGrouper

N = 1000
ind = pd.date_range(start="2000-01-01", freq="D", periods=N)
df = pd.DataFrame({'open':1, 'close':2}, index=ind)
tg = TimeGrouper('M')
grouper = tg.get_grouper(df)
# Errors
df.groupby(grouper).apply(lambda df: df['close'] / df['open'])
# AttributeError: 'BinGrouper' object has no attribute 'groupings'

Error does not occur for regular Grouper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants