Checking for NaT in PeriodIndex doesn't work with None, pd.NaT · Issue #13582 · pandas-dev/pandas (original) (raw)

Code Sample, a copy-pastable example if possible

None in pd.period_range('2015-01-01', periods=1, freq='D').insert(0, pd.NaT) False

Incorrect behavior for pd.NaT, None, float('nan'), np.nan

Expected Output

None in pd.period_range('2015-01-01', periods=1, freq='D').insert(0, pd.NaT) True

output of pd.show_versions()

pd.show_versions()

INSTALLED VERSIONS

commit: None python: 2.7.11.final.0 python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None

pandas: 0.18.1 nose: 1.3.7 pip: 8.1.2 setuptools: 23.0.0 Cython: 0.24 numpy: 1.10.4 scipy: 0.17.1 statsmodels: None xarray: 0.7.2 IPython: None sphinx: None patsy: None dateutil: 2.5.3 pytz: 2016.4 blosc: None bottleneck: 1.0.0 tables: 3.2.2 numexpr: 2.5.2 matplotlib: 1.5.1 openpyxl: 2.3.2 xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: None httplib2: None apiclient: None sqlalchemy: 1.0.13 pymysql: None psycopg2: None jinja2: 2.8 boto: 2.40.0 pandas_datareader: None