0.摘要
pandas中DataFrame类型中,找出所有有空值的行,可以使用.isnull()方法和.any()方法。
1.找出含有空值的行
方法:DataFrame[DataFrame.isnull().T.any()]
其中,isnull()能够判断数据中元素是否为空值;T为转置;any()判断该行是否有空值。
import pandas as pd
import numpy as np
n = np.arange(20, dtype=float).reshape(5,4)
n[2,3] = np.nan
index = ['index1', 'index2', 'index3', '