BUG: replace coerces incorrect dtype
closes #12747

Author: sinhrks <sinhrks@gmail.com>

This patch had conflicts when merged, resolved by
Committer: Jeff Reback <jeff@reback.net>

closes #15742
Closes #12780 from sinhrks/replace_type and squashes the following commits:

f9154e8 [sinhrks] remove unnecessary comments
279fdf6 [sinhrks] remove import failure
de44877 [sinhrks] BUG: replace coerces incorrect dtype
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15742?src=pr&el=h1) Report
> Merging [#15742](https://codecov.io/gh/pandas-dev/pandas/pull/15742?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b1e29dba26ff86b826fe0f866182466ae42c0bc5?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `89.65%`.


```diff
@@            Coverage Diff             @@
##           master   #15742      +/-   ##
==========================================
- Coverage   91.01%   91.01%   -0.01%     
==========================================
  Files         143      143              
  Lines       49380    49401      +21     
==========================================
+ Hits        44943    44961      +18     
- Misses       4437     4440       +3
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15742?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/internals.py](https://codecov.io/gh/pandas-dev/pandas/compare/b1e29dba26ff86b826fe0f866182466ae42c0bc5...8bde21a9f01c4a09d6e305906e81794b45935d5e?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzLnB5) | `93.62% <100%> (+0.02%)` | :arrow_up: |
| [pandas/types/cast.py](https://codecov.io/gh/pandas-dev/pandas/compare/b1e29dba26ff86b826fe0f866182466ae42c0bc5...8bde21a9f01c4a09d6e305906e81794b45935d5e?src=pr&el=tree#diff-cGFuZGFzL3R5cGVzL2Nhc3QucHk=) | `85.11% <80%> (-0.35%)` | :arrow_down: |
| [pandas/tseries/index.py](https://codecov.io/gh/pandas-dev/pandas/compare/b1e29dba26ff86b826fe0f866182466ae42c0bc5...8bde21a9f01c4a09d6e305906e81794b45935d5e?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvaW5kZXgucHk=) | `95.29% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/compare/b1e29dba26ff86b826fe0f866182466ae42c0bc5...8bde21a9f01c4a09d6e305906e81794b45935d5e?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.3% <0%> (+0.33%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15742?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/15742?src=pr&el=footer). Last update [b1e29db...8bde21a](https://codecov.io/gh/pandas-dev/pandas/compare/b1e29dba26ff86b826fe0f866182466ae42c0bc5...8bde21a9f01c4a09d6e305906e81794b45935d5e?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).