Open
Description
Now that Categorical
depends on ExtensionArray
, it makes more sense to return and output pd.NA
as a missing value instead of np.nan
.
Propose that we announce in 2.0 release that this will change in a future release. Not clear if/how we create a deprecation message here.
Current behavior:
>>> c = pd.Categorical( ["a", "a", "b", "c", "c"], ["a", "b", "c"])
>>> c
['a', 'a', 'b', 'c', 'c']
Categories (3, object): ['a', 'b', 'c']
>>> s = pd.Series(c)
>>> s
0 a
1 a
2 b
3 c
4 c
dtype: category
Categories (3, object): ['a', 'b', 'c']
>>> s.iloc[2] = pd.NA
>>> s.iloc[2]
nan