📜  用 nan python 代码示例替换异常值

📅  最后修改于: 2022-03-11 14:46:30.097000             🧑  作者: Mango

代码示例1
df.mask(df.sub(df.mean()).div(df.std()).abs().gt(2))

    c1   c2  c3 
0  NaN  1.0  2.0
1  1.0  3.0  4.0
2  2.0  5.0  6.0
3  3.0  1.0  NaN
4  4.0  3.0  4.0
5  5.0  5.0  6.0
6  6.0  NaN  6.0