isnull not detecting NaT in PeriodIndex · Issue #9129 · pandas-dev/pandas (original) (raw)

@unutbu

In [158]: x = pd.to_datetime([np.nan, '2000-1-1'])

In [159]: y = x.to_period(freq='m')

In [160]: y
Out[160]: 
<class 'pandas.tseries.period.PeriodIndex'>
[NaT, 2000-01]
Length: 2, Freq: M

In [161]: pd.isnull(x)
Out[161]: array([ True, False], dtype=bool)

In [162]: pd.isnull(y)
Out[162]: array([False, False], dtype=bool)

I think pd.isnull(y) should be returning array([True, False], dtype=bool).