时间:2020-11-05 18:22:19 | 栏目:Python代码 | 点击:次
如下所示:
import pandas as pd from pandas import * import numpy as np data = Series([1,-999,2,-999,-1000,3]) print(data.replace(-999,np.nan)) print(data.replace([-999,-1000],np.nan)) print(data.replace([-999,-1000],[np.nan,0])) print(data.replace({-999:np.nan,-1000:0}))