Skip to content

BUG: resample with non-existant columns #16973

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
wants to merge 1 commit into from

Conversation

leosartaj
Copy link

I have added a check for keys in Resampler._gotitem. I am not sure if it's the best place to put this check. df.groupby('x').agg({'z': ['sum'] }) works as pointed out by @chris-b1 but I suspect there is no explicit check if the key exists or not. From what I found the code errors inside DataFrameGroupBy._gotitem, due to the self.obj[key] call which is not in Resampler._gotitem. If this is a suitable fix, I can add similar check in DataFrameGroupBy._gotitem (current traceback is very messy).

@leosartaj
Copy link
Author

TODO: Add tests.

@jreback
Copy link
Contributor

jreback commented Jul 16, 2017

needs tests from the issue.

@jreback jreback added Bug Resample resample method labels Jul 16, 2017
@jreback jreback changed the title add check for keys in _gotitem BUG: resample with non-existant columns Jul 16, 2017
@jreback
Copy link
Contributor

jreback commented Aug 18, 2017

closing as stale

@jreback jreback closed this Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Resample resample method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

using DataFrame.resample with 'agg' method on non-existant columns provides unexpected behavior
2 participants