ERR: consistency in rolling on empty frames #15819

Closed
jreback opened this Issue Mar 27, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@jreback
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 this to the Next Major Release milestone Mar 27, 2017

@jreback

This comment has been minimized.

Show comment
Hide comment
@chrisaycock

This comment has been minimized.

Show comment
Hide comment
@chrisaycock

chrisaycock Mar 28, 2017

Contributor

I agree they should be consistent.

Contributor

chrisaycock commented Mar 28, 2017

I agree they should be consistent.

@chernrick

This comment has been minimized.

Show comment
Hide comment
@chernrick

chernrick May 22, 2017

Contributor

Working on this at PyCon sprint

Contributor

chernrick commented May 22, 2017

Working on this at PyCon sprint

@chernrick chernrick referenced this issue May 22, 2017

Merged

15819 rolling window on empty df #16431

4 of 4 tasks complete
@chernrick

This comment has been minimized.

Show comment
Hide comment

@jreback jreback modified the milestones: 0.20.2, Next Major Release May 23, 2017

@jreback jreback closed this in #16431 May 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment