pd.isnull
作品(反復可能であるもの)例えば
>>> import pandas as pd
>>> import numpy as np
>>> pd.isnull(np.array([1, 2]))
array([False, False], dtype=bool)
>>> pd.isnull([1, 2])
array([False, False], dtype=bool)
df.isnull
のに対し、あなたのデータフレームのオブジェクトにバインドされたメンバ関数です。したがって、最初にDataFrameを作成する場合にはコストがかかりますが、pd.isnull
を使用します。
タイミング:
In [30]: %timeit pd.isnull([1,2])
The slowest run took 8.93 times longer than the fastest. This could mean that an intermediate result is being cached.
100000 loops, best of 3: 9.19 µs per loop
In [33]: %timeit pd.DataFrame([1,2]).isnull()
The slowest run took 6.42 times longer than the fastest. This could mean that an intermediate result is being cached.
1000 loops, best of 3: 202 µs per loop
関連:[なぜ、多くのndarray方法のために、対応する機能を持ってnumpyのん?](http://stackoverflow.com/questions/29120730/why-does-numpy-have -a対応関数のための多数のndarray法) – ayhan