我希望在pandas dataframe中新增一列,根据输入列进行计算。新增的列应按以下方式填充。
- first row must be populated with nearest divide by 100 number.
from next row onwards output will be repeated until its difference with input value is more than or equal to 100.
input output 11700.15 11700 11695.20 11700 11661.00 11700 11630.40 11700 11666.10 11700 11600.30 11700 11600.00 11600 11555.40 11600 11655.20 11600 11699.00 11600 11701.55 11700 11799.44 11700 11604.65 11700 11600.33 11700 11599.65 11600
在 Pandas 中,最优雅的方式是什么?
(11700 - 11600.33) < 100
和(11700 - 11599.65 > 100)
。 - filippo