Skip to content

BUG: rolling not accepting Timedelta-like window args (#15440) #15443

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

Merged
merged 1 commit into from
Feb 18, 2017

Conversation

mroeschke
Copy link
Member

Allow rolling() to accept pd.Timedelta or datetime.timedelta as a window argument.

@@ -1014,7 +1015,8 @@ def validate(self):

# we allow rolling on a datetimelike index
if (self.is_datetimelike and
isinstance(self.window, (compat.string_types, DateOffset))):
isinstance(self.window, (compat.string_types, DateOffset,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need pd.Timedelta here (its a sub-class of timedelta).

@jreback jreback added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Timedelta Timedelta data type labels Feb 17, 2017
@jreback
Copy link
Contributor

jreback commented Feb 17, 2017

lgtm. minor change. ping on green.

@jreback jreback added this to the 0.20.0 milestone Feb 17, 2017
@mroeschke
Copy link
Member Author

Removed pd.Timedelta from isinstance check.

Looks like appveyor failed early:

Build started
git clone -q https://github.com/pandas-dev/pandas.git C:\projects\pandas-465
fatal: early EOF
fatal: The remote end hung up unexpectedly
fatal: index-pack failed
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
Command exited with code 128

@jreback
Copy link
Contributor

jreback commented Feb 18, 2017

yeah its fine. ping on green from travis.

@mroeschke
Copy link
Member Author

Ping travis green

@jorisvandenbossche jorisvandenbossche merged commit 29aeffb into pandas-dev:master Feb 18, 2017
@jorisvandenbossche
Copy link
Member

@mroeschke Thanks!

@chrisaycock
Copy link
Contributor

@mroeschke Thanks for taking a crack at this!

AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
@mroeschke mroeschke deleted the fix_15440 branch December 20, 2017 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reshaping Concat, Merge/Join, Stack/Unstack, Explode Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding Timedelta parameter to time-based .rolling()
4 participants