MAINT: port numpy#13188 for np_datetime simplification
State: closed

Bring numpy changes about emulating the behavior of python's divmod to
pandas.

- [x] closes #26500
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Dependencies
description: Required and optional dependencies

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26516?src=pr&el=h1) Report
> Merging [#26516](https://codecov.io/gh/pandas-dev/pandas/pull/26516?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b730ab35e8fe1540d121cf7b336f454df59f7d4d?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #26516      +/-   ##
==========================================
- Coverage   91.76%   91.75%   -0.01%     
==========================================
  Files         174      174              
  Lines       50679    50679              
==========================================
- Hits        46504    46499       -5     
- Misses       4175     4180       +5
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.26% <ø> (ø)` | :arrow_up: |
| #single | `41.7% <ø> (-0.11%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26516?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26516/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26516/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26516/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.6% <0%> (-0.11%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26516?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/26516?src=pr&el=footer). Last update [b730ab3...5804bad](https://codecov.io/gh/pandas-dev/pandas/pull/26516?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/26516?src=pr&el=h1) Report
> Merging [#26516](https://codecov.io/gh/pandas-dev/pandas/pull/26516?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b730ab35e8fe1540d121cf7b336f454df59f7d4d?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #26516      +/-   ##
==========================================
- Coverage   91.76%   91.74%   -0.02%     
==========================================
  Files         174      174              
  Lines       50679    50665      -14     
==========================================
- Hits        46504    46485      -19     
- Misses       4175     4180       +5
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.26% <ø> (-0.01%)` | :arrow_down: |
| #single | `41.71% <ø> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26516?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26516/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/io/excel/\_base.py](https://codecov.io/gh/pandas-dev/pandas/pull/26516/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2V4Y2VsL19iYXNlLnB5) | `91.85% <0%> (-0.29%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26516/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26516/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.6% <0%> (-0.11%)` | :arrow_down: |
| [pandas/core/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/26516/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXBpLnB5) | `100% <0%> (ø)` | :arrow_up: |

------

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

Generally looks good.  Were there any parts that weren't copy/paste?
> Generally looks good. Were there any parts that weren't copy/paste?

All changes are copied from numpy PR. I changed a few line style since those lines over 80 characters.


lgtm. @jbrockmendel merge when ready.
Thanks @xcz011