Skip to content

isnull not detecting NaT in PeriodIndex #9129

Closed
@unutbu

Description

@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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatePeriodPeriod data type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions