BUG GH23282 calling min on series of NaT returns NaT
State: closed

- [X] closes #23282 
- [X] tests passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

For `max`, `NaT` values are filled with the lowest possible value. For `min`, they are filled with the highest possible value. The problem is that only the lowest possible value is recognized as `NaT`. Since `nanops.py` is responsible for assigning the highest value to `NaT` when min is called, it should also be responsible for translating it to `NaT` when appropriate.

Labels:
name: Bug
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
Hello @JustinZhengBC! Thanks for updating the PR.

 - There are no PEP8 issues in the file [`pandas/core/nanops.py`](https://github.com/JustinZhengBC/pandas/blob/314b2bc1bcfa93b81635abc5a0ab041d7b9673be/pandas/core/nanops.py) !

 - There are no PEP8 issues in the file [`pandas/tests/series/test_datetime_values.py`](https://github.com/JustinZhengBC/pandas/blob/314b2bc1bcfa93b81635abc5a0ab041d7b9673be/pandas/tests/series/test_datetime_values.py) !



##### Comment last updated on October 25, 2018 at 23:07 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23289?src=pr&el=h1) Report
> Merging [#23289](https://codecov.io/gh/pandas-dev/pandas/pull/23289?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/437f31cb609372f465aaa853bf4b2299a9550716?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `93.75%`.

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

```diff
@@            Coverage Diff             @@
##           master   #23289      +/-   ##
==========================================
- Coverage   92.22%   92.22%   -0.01%     
==========================================
  Files         169      169              
  Lines       51258    51266       +8     
==========================================
+ Hits        47274    47281       +7     
- Misses       3984     3985       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.66% <93.75%> (-0.01%)` | :arrow_down: |
| #single | `42.23% <43.75%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23289?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/nanops.py](https://codecov.io/gh/pandas-dev/pandas/pull/23289/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvbmFub3BzLnB5) | `95.05% <93.75%> (-0.15%)` | :arrow_down: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/23289/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `93.91% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/arrays/sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/23289/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3NwYXJzZS5weQ==) | `91.84% <0%> (ø)` | :arrow_up: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/23289/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `97.46% <0%> (ø)` | :arrow_up: |
| [pandas/core/dtypes/cast.py](https://codecov.io/gh/pandas-dev/pandas/pull/23289/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2Nhc3QucHk=) | `89.28% <0%> (+0.05%)` | :arrow_up: |

------

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

i pushed a commit. have a look.
@jreback I added a whatsnew note and an assert in the datetime64 case (adding the assert to the timedelta64 case causes tests to fail)
lgtm. @WillAyd over to you.
Thanks @JustinZhengBC !