BUG: inconsistent replace
State: closed

- [x] tests added
- [x] tests passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] release note in `doc/source/whatsnew/v1.1.3.rst`

Must fix some replace in IntBlock if called with float integer (such as 1.0).


closes #35376

Labels:
name: Bug
name: Regression
description: Functionality that used to work in a prior pandas version
name: replace
description: replace method

Comments:
Thanks @QuentinN42 for the PR. needs tests see https://github.com/pandas-dev/pandas/issues/35376#issuecomment-694733759 and a release note in doc/source/whatsnew/v1.1.3.rst
> pls always add a test that reproduces the issue _first_ to make sure it fails.

Test added.
@QuentinN42 Can you merge master to fix merge conflict? Also I think this doesn't need to be a draft.
Hello @QuentinN42! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-09-25 11:06:55 UTC
I've rolled back on typo from f64817b to pass the PEP8 test.
But it may not pass the CI / Checks (PR)
How can we see wich tests have failed and what is the given output ?
> How can we see wich tests have failed and what is the given output ?

may be fixed by #36511
> > How can we see wich tests have failed and what is the given output ?
> 
> may be fixed by #36511

 #36511 has been merged.
> #36511 has been merged.

i've restarted the tests since (azure normally picks up the changes in master) but it looks like there are still failures.

can you merge upstream/master into this branch
I have a feeling that there are reproducibility errors with black.
On my personals repos, I've removed it from pre-commit for this errors.

On server :
```
black....................................................................Failed
- hook id: black
- files were modified by this hook

reformatted /home/runner/work/pandas/pandas/pandas/tests/frame/methods/test_replace.py
All done! ✨ 🍰 ✨
1 file reformatted, 1133 files left unchanged.

flake8...................................................................Passed
flake8-pyx...............................................................Passed
flake8-pxd...............................................................Passed
isort....................................................................Passed
pyupgrade................................................................Passed
```
On local :
```
black....................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

pandas/core/generic.py:1:1: F407 future feature annotations is not defined
pandas/core/algorithms.py:5:1: F407 future feature annotations is not defined
pandas/core/construction.py:7:1: F407 future feature annotations is not defined
pandas/core/frame.py:11:1: F407 future feature annotations is not defined

flake8-pyx...............................................................Passed
flake8-pxd...............................................................Passed
isort....................................................................Passed
```

The error come from this line (`pandas/tests/frame/methods/test_replace.py`):
```
(DataFrame([[1, 1.0], [2, 2.0]]), 1, 5, DataFrame([[5, 5.0], [2, 2.0]]),),
```
that black want to split into :
```
(
    DataFrame([[1, 1.0], [2, 2.0]]),
    1,
    5,
    DataFrame([[5, 5.0], [2, 2.0]]),
),
```
@QuentinN42 the version of black used on ci was changed yesterday. see #36493

updating black locally and merging upstream/master will probably fix.
The error come from `pandas/tests/test_sorting.py::TestSafeSort::test_codes_out_of_bound`.
Not me :cry: (I hope).
> The error come from `pandas/tests/test_sorting.py::TestSafeSort::test_codes_out_of_bound`.
> Not me 😢 (I hope).

seen b4 https://github.com/pandas-dev/pandas/pull/36382#issuecomment-692707377

restarted ci
@jreback green https://github.com/pandas-dev/pandas/pull/36444#pullrequestreview-493882423
the current comment is not useful - needs to be updated
I've changed into :
```
We have not inferred an integer from the dtype
check if we have a builtin int or a float equal to an int
```
@jreback ok to merge on green?
thanks @QuentinN42 
@meeseeksdev backport 1.1.x