Код: Выделить всё
df1 = pd.DataFrame(np.arange(15).reshape(5,3))
df1.iloc[:4,1] = np.nan
df1.iloc[:2,2] = np.nan
df1.dropna(thresh=1 ,axis=1)
Код: Выделить всё
0 1 2
0 0 NaN NaN
1 3 NaN NaN
2 6 NaN 8.0
3 9 NaN 11.0
4 12 13.0 14.0
Код: Выделить всё
df1.dropna(thresh=2,axis=1)
Код: Выделить всё
0 2
0 0 NaN
1 3 NaN
2 6 8.0
3 9 11.0
4 12 14.0
Подробнее здесь: https://stackoverflow.com/questions/515 ... -in-python