Backport PR #31545 on branch 1.0.x (BUG&TST: df.replace fail after converting to new dtype)
Backport PR #31545: BUG&TST: df.replace fail after converting to new dtype
I think need to back port #31484 first - @charlesdong1991 something you can do? never did that well, I could try @WillAyd  i think i messed it up, have to close it, I would appreciate a lot if you could give some help or directly take it over. @WillAyd  checkout the 1.0.x branch locally and cherry pick the squashed commit from your other PR on top of it. Then push to GitHub targeting the 1.0 branch instead of master thanks for quick reply! emm, thats basically what i did, but somehow got tons of other commits along with, not sure if the master branch i have locally is way ahead of 1.0.x? ahh!, get it! @WillAyd i accidentally merge master to 1.0.x , my bad, new PR is there! and looks good #31562 @charlesdong1991 can you rebase this (on this branch) yeah, i am pretty going nuts by an error, i `remote add` the repo, and rebased on this branch, but when i am pushing the commits, get  

```
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/meeseeksmachine/pandas.git/'
```
but i am 100% sure it is correct because i am using it to login/out my github account, any reason why this could happen? @jreback  🙏  pushed https://github.com/pandas-dev/pandas/pull/31584 sorry for that, I still could not figure out the problem 😞 and thanks for getting this done @jreback 