BUG: pandas.cut should disallow overlapping IntervalIndex bins
State: closed

- [ ] closes #23980 
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Interval
description: Interval data type

Comments:
Hello @charlesdong1991! Thanks for updating the PR.

 - There are no PEP8 issues in the file [`pandas/core/reshape/tile.py`](https://github.com/charlesdong1991/pandas/blob/4bfcea2601d2199225c8002c6e7c82af0f178694/pandas/core/reshape/tile.py) !

 - There are no PEP8 issues in the file [`pandas/tests/reshape/test_tile.py`](https://github.com/charlesdong1991/pandas/blob/4bfcea2601d2199225c8002c6e7c82af0f178694/pandas/tests/reshape/test_tile.py) !



##### Comment last updated on November 30, 2018 at 08:17 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23999?src=pr&el=h1) Report
> Merging [#23999](https://codecov.io/gh/pandas-dev/pandas/pull/23999?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/7653a6b43a8a302bc1d88903c8c99730a00bcc80?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/23999/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23999?src=pr&el=tree)

```diff
@@            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%> (ø)` | :arrow_up: |
| #single | `42.44% <0%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23999?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/tile.py](https://codecov.io/gh/pandas-dev/pandas/pull/23999/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS90aWxlLnB5) | `94.76% <100%> (+0.03%)` | :arrow_up: |
| [pandas/core/arrays/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/23999/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3RpbWVkZWx0YXMucHk=) | `96% <0%> (+0.04%)` | :arrow_up: |
| [pandas/core/tools/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/23999/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvZGF0ZXRpbWVzLnB5) | `85.53% <0%> (+0.08%)` | :arrow_up: |
| [pandas/core/indexes/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/23999/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy90aW1lZGVsdGFzLnB5) | `90.11% <0%> (+0.5%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23999?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23999?src=pr&el=footer). Last update [7653a6b...4bfcea2](https://codecov.io/gh/pandas-dev/pandas/pull/23999?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

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!
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:
```rst
- Bug in :func:`cut` with ``bins`` as an overlapping ``IntervalIndex`` where multiple bins were returned per item instead of raising a ``ValueError`` (:issue:`23980`)
```
@jschendel , ahh, I see!! Thank you very much, added!
thanks @charlesdong1991!