pandas where 用法
生活随笔
收集整理的這篇文章主要介紹了
pandas where 用法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
s = pd.Series(range(5))
0 0
1 1
2 2
3 3
4 4
dtype: int64
s.where(s >= 1, 10)
大于等于1的值不動,小于1的值替換成10
0 10 1 1 2 2 3 3 4 4 dtype: int64總結
以上是生活随笔為你收集整理的pandas where 用法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: anaconda 运行路径
- 下一篇: 因子分解机 Factorization