我想你可以做:
maxVal = 15df['a'].where(df['a'] <= maxVal, maxVal) # where replace values with other when the # condition is not satisfied#0 10#1 12#2 15#3 15#4 15#5 15#Name: a, dtype: int64
要么:
df['a'][df['a'] >= maxVal] = maxVal
欢迎分享,转载请注明来源:内存溢出
我想你可以做:
maxVal = 15df['a'].where(df['a'] <= maxVal, maxVal) # where replace values with other when the # condition is not satisfied#0 10#1 12#2 15#3 15#4 15#5 15#Name: a, dtype: int64
要么:
df['a'][df['a'] >= maxVal] = maxVal
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)