Skip to content

BUG: TimedeltaIndex raising ValueError when boolean indexing (#14946) #15221

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

mroeschke
Copy link
Member

Implementing patch suggested by @jreback here that prevents raising a ValueError when boolean indexing with a TimedeltaIndex

@jorisvandenbossche jorisvandenbossche added Bug Indexing Related to indexing on series/frames, not to indexes themselves Timedelta Timedelta data type labels Jan 25, 2017
@@ -2052,6 +2052,22 @@ def test_add_overflow(self):
to_timedelta(['7 seconds', pd.NaT, '4 hours']))
tm.assert_index_equal(result, exp)

def test_boolean_indexing(self):
# GH 14946
Copy link
Contributor

Choose a reason for hiding this comment

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

put this in pandas/tests/indexing

create a new class for TimedeltaIndex

might be some other timedelta indexing routines you can group with it

@codecov-io
Copy link

codecov-io commented Jan 26, 2017

Current coverage is 86.31% (diff: 100%)

Merging #15221 into master will increase coverage by <.01%

@@             master     #15221   diff @@
==========================================
  Files           139        139          
  Lines         51091      51093     +2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          44099      44101     +2   
  Misses         6992       6992          
  Partials          0          0          

Powered by Codecov. Last update 0c8442c...b8ac04e

@mroeschke
Copy link
Member Author

Moved the tests to pandas/tests/indexing/test_indexing.py, created class for TimedeltaIndex, and all green. I didn't find any tests here that tested TimedeltaIndex exclusively, so I didn't group any more under this class.

@jreback jreback added this to the 0.20.0 milestone Jan 26, 2017
@jreback jreback closed this in be32852 Jan 26, 2017
@jreback
Copy link
Contributor

jreback commented Jan 26, 2017

thanks @mroeschke keep em coming!

AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
…dev#14946)

closes pandas-dev#14946

Author: Matt Roeschke <[email protected]>

Closes pandas-dev#15221 from mroeschke/fix_14946 and squashes the following commits:

b8ac04e [Matt Roeschke] BUG: TimedelaIndex raising ValueError when boolean indexing (pandas-dev#14946)
@mroeschke mroeschke deleted the fix_14946 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
Bug Indexing Related to indexing on series/frames, not to indexes themselves Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValueError when using loc with TimedeltaIndex
4 participants