【发布时间】:2019-01-31 02:51:26
【问题描述】:
我正在尝试找到允许我从同一列中倒数第二个值中的值减去一列最后一行中的值的代码。这是我尝试过的。
df_stock2['eps_median_est'][-1] - df_stock2['eps_median_est'][-2]
error is : TypeError: an integer is required
我的数据类型是
eps_median_est, dtype: float64
【问题讨论】:
标签: python python-3.x pandas indexing series