DOC: fix warnings in docstrings examples for deprecated functions
State: closed

- [x] closes #24525
- [ ] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

I have updated all the `FutureWarning`, let me know if `PerformanceWarning` and `DtypeWarning`  shown below also needs a fix.

```zsh
python scripts/validate_docstrings.py --errors GL06,GL07,GL09,SS04,PR03,PR05,EX04
scripts/validate_docstrings.py:764: PerformanceWarning: indexing past lexsort depth may impact performance.
  errs, wrns, examples_errs = get_validation_data(doc)
scripts/validate_docstrings.py:764: PerformanceWarning: indexing past lexsort depth may impact performance.
  errs, wrns, examples_errs = get_validation_data(doc)
scripts/validate_docstrings.py:524: DtypeWarning: Columns (0) have mixed types. Specify dtype option on import or set low_memory=False.
  runner.run(test, out=f.write)
```


Labels:
name: Docs
name: Deprecate
description: Functionality to remove in pandas

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24642?src=pr&el=h1) Report
> Merging [#24642](https://codecov.io/gh/pandas-dev/pandas/pull/24642?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/510afa70bc3513e64848ad9cbd21c2acbc0f6459?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #24642   +/-   ##
=======================================
  Coverage   92.37%   92.37%           
=======================================
  Files         166      166           
  Lines       52388    52388           
=======================================
  Hits        48396    48396           
  Misses       3992     3992
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.8% <ø> (ø)` | :arrow_up: |
| #single | `43% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24642?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24642/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `98.01% <ø> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/24642/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.62% <ø> (ø)` | :arrow_up: |

------

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

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24642?src=pr&el=h1) Report
> Merging [#24642](https://codecov.io/gh/pandas-dev/pandas/pull/24642?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/d106e9975100cd0f2080d7b1a6111f20fb64f906?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #24642   +/-   ##
=======================================
  Coverage   92.37%   92.37%           
=======================================
  Files         166      166           
  Lines       52379    52379           
=======================================
  Hits        48386    48386           
  Misses       3993     3993
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.8% <ø> (ø)` | :arrow_up: |
| #single | `43.01% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24642?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24642/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `97.85% <ø> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/24642/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.62% <ø> (ø)` | :arrow_up: |

------

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

lgtm. ping on green.
thanks @nixphix