BUG: Check types in Index.__contains__ (#22085)
State: closed

- [x] closes #22085
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I added is_float, is_integer_dtype in Index.\_\_contains\_\_.
If key is float and dtype of Index object is integer, return False.

Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
Hello @yeojin-dev! Thanks for updating the PR.



Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on August 30, 2018 at 15:29 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22360?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@98e77e9`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff            @@
##             master   #22360   +/-   ##
=========================================
  Coverage          ?   92.04%           
=========================================
  Files             ?      169           
  Lines             ?    50783           
  Branches          ?        0           
=========================================
  Hits              ?    46741           
  Misses            ?     4042           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.45% <ø> (?)` | |
| #single | `42.22% <ø> (?)` | |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22360?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/22360?src=pr&el=footer). Last update [98e77e9...0b8217e](https://codecov.io/gh/pandas-dev/pandas/pull/22360?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

note that this duplicates #22366 

need tests & a whatsnew entry
@jreback Thank you for checking my PR. I added test and whatsnew. I hope these may help you. 😊
@jreback I fixed them. Please check. 😊
 @jreback Could you please give me your feedback on my last commit?
@jreback My new commits has just passed a test in my Mac. But can't here, GitHub.

See the logs below.

1. Travis
```
ImportError: libgfortran.so.1: cannot open shared object file: No such file or directory
The command "ci/install_travis.sh" failed and exited with 1 during .
```

2. Circle
```
ImportError: libgfortran.so.1: cannot open shared object file: No such file or directory
```

I guess these errors are not caused by my commits. Please check.
@jreback I wrote the code in Cython. But my code has just passed the test, can't pass here. I can't understand... 😢
can you rebase
@jreback Sorry. I deleted the branch while rebasing it. Please see my new PR.