![](/img/trans.png)
[英]Determine a value based on the difference between another column of this row and the previous row
[英]Modify values in 1 column based on the value in another column in the previous row
移位功能有效。 要将Min_val保留在第一列中,您只需使用loc
函数指定1:
否则它将第一行设置为NaN
df_ticker.loc[1:,'Min_val'] = df_ticker['Max_val'].shift(1) + 1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.