dti = pd.date_range("2016-01-01", periods=3)
ci = pd.Categorical(dti._values)
>>> pd.Categorical(["foo"], dtype=ci.dtype)
[NaT]
Categories (3, datetime64[ns]): [2016-01-01, 2016-01-02, 2016-01-03]
Casting "foo" to pd.NaT here makes very little sense to me, and does not match the behavior of any of our other constructors. I'm pretty sure this is why we have to do so much special-casing for Categorical in dtypes.cast and groupby ops.
Suggestion: we change/deprecate the behavior to raise instead of cast.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4