Skip to content
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

BUG: pandas.cut should disallow overlapping IntervalIndex bins #23999

Conversation

charlesdong1991
Copy link
Member

@charlesdong1991 charlesdong1991 commented Nov 29, 2018

@pep8speaks
Copy link

pep8speaks commented Nov 29, 2018

Hello @charlesdong1991! Thanks for updating the PR.

Comment last updated on November 30, 2018 at 08:17 Hours UTC

@codecov
Copy link

codecov bot commented Nov 29, 2018

Codecov Report

Merging #23999 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23999      +/-   ##
==========================================
+ Coverage    92.3%   92.31%   +<.01%     
==========================================
  Files         161      161              
  Lines       51555    51550       -5     
==========================================
- Hits        47589    47587       -2     
+ Misses       3966     3963       -3
Flag Coverage Δ
#multiple 90.7% <100%> (ø) ⬆️
#single 42.44% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/reshape/tile.py 94.76% <100%> (+0.03%) ⬆️
pandas/core/arrays/timedeltas.py 96% <0%> (+0.04%) ⬆️
pandas/core/tools/datetimes.py 85.53% <0%> (+0.08%) ⬆️
pandas/core/indexes/timedeltas.py 90.11% <0%> (+0.5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7653a6b...4bfcea2. Read the comment docs.

@charlesdong1991 charlesdong1991 changed the title Disallow intervalindex bins backup BUG: pandas.cut should disallow overlapping IntervalIndex bins Nov 29, 2018
@jschendel jschendel added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Interval Interval data type labels Nov 29, 2018
@jschendel jschendel added this to the 0.24.0 milestone Nov 29, 2018
Copy link
Member

@jschendel jschendel left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good overall. A couple comments:

  • Can you add a whatsnew note to 0.24.0 under the Reshaping subsection of the Bug Fixes section?
  • Can you add "Must be non-overlapping." to cut docstring, at the end of the IntervalIndex portion of the bins parameter description?

pandas/tests/reshape/test_tile.py Outdated Show resolved Hide resolved
@charlesdong1991
Copy link
Member Author

charlesdong1991 commented Nov 29, 2018

Hi, @jschendel , thanks for the review and advices!! As for Can you add a whatsnew note to 0.24.0 under the Reshaping subsection of the Bug Fixes section?, I am not sure if I did it correctly (what i did was just tick the whatsnew entry above). Please give me more hints if it's not what you meant, sorry that I am not familiar with this part. And thanks again!

@jschendel
Copy link
Member

For the whatsnew entry, you'll need to edit the /doc/source/whatsnew/v0.24.0.rst file at around line 1485 to add an entry along the lines of:

- Bug in :func:`cut` with ``bins`` as an overlapping ``IntervalIndex`` where multiple bins were returned per item instead of raising a ``ValueError`` (:issue:`23980`)

@charlesdong1991
Copy link
Member Author

@jschendel , ahh, I see!! Thank you very much, added!

@jschendel jschendel merged commit fa547d8 into pandas-dev:master Dec 1, 2018
@jschendel
Copy link
Member

thanks @charlesdong1991!

gfyoung added a commit to forking-repos/pandas that referenced this pull request Dec 1, 2018
gfyoung added a commit that referenced this pull request Dec 1, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Interval Interval data type Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pandas.cut should disallow overlapping IntervalIndex bins
3 participants