Skip to content

Conversation

@mroeschke
Copy link
Member

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

# 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