datetime - Python pandas .isnull() does not work on NaT in object dtype -


i have series:

ser=pd.series([11,22,33,np.nan,np.datetime64('nat')],name='my_series') 

the series looks this:

0     11 1     22 2     33 3    nan 4    nan name: my_series, dtype: object 

but 1 true null values:

ser.isnull()  0    false 1    false 2    false 3     true 4    false name: my_series, dtype: bool 

is bug or how can count correctly null values in pandas series? not help:

ser=ser.replace('nan',np.nan) 

thanks!

to around this, can do

series.apply(lambda x: str(x) == "nat")

then can still use np.datetime if want


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -