pythonbook/实例学习pandas/3 替换函数.py

6 lines
85 B
Python

import pandas as pd
s = pd.Series([-1, 1.2345, 100, -50])
print(s.where(s<0, 100))