Skip to content

ERR: consistency in rolling on empty frames #15819

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
jreback opened this issue Mar 27, 2017 · 4 comments · Fixed by #16431
Closed

ERR: consistency in rolling on empty frames #15819

jreback opened this issue Mar 27, 2017 · 4 comments · Fixed by #16431
Labels
Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Mar 27, 2017

xref https://github.com/pandas-dev/pandas/pull/15795/files#r108178445

I think we should just return an empty frame for [4]

In [4]: DataFrame().rolling('1s').sum()
ValueError: window must be an integer

In [5]: DataFrame().rolling(1).sum()
Out[5]: 
Empty DataFrame
Columns: []
Index: []

though this works.

In [7]: DataFrame(index=pd.DatetimeIndex([])).rolling(1).sum()
Out[7]: 
Empty DataFrame
Columns: []
Index: []

In [8]: DataFrame(index=pd.DatetimeIndex([])).rolling('1s').sum()
Out[8]: 
Empty DataFrame
Columns: []
Index: []
@jreback jreback added Difficulty Novice Error Reporting Incorrect or improved errors from pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode Datetime Datetime data dtype labels Mar 27, 2017
@jreback jreback added this to the Next Major Release milestone Mar 27, 2017
@jreback
Copy link
Contributor Author

jreback commented Mar 27, 2017

cc @chrisaycock
cc @carlosdanielcsantos

@chrisaycock
Copy link
Contributor

I agree they should be consistent.

@chernrick
Copy link
Contributor

Working on this at PyCon sprint

@chernrick
Copy link
Contributor

@jreback jreback modified the milestones: 0.20.2, Next Major Release May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants