我认为您想做这样的事情:
In [26]: dataOut[26]: Date Close Adj Close251 2011-01-03 147.48 143.25250 2011-01-04 147.64 143.41249 2011-01-05 147.05 142.83248 2011-01-06 148.66 144.40247 2011-01-07 147.93 143.69In [27]: data.set_index('Date').diff()Out[27]: Close Adj CloseDate 2011-01-03 NaN NaN2011-01-04 0.16 0.162011-01-05 -0.59 -0.582011-01-06 1.61 1.572011-01-07 -0.73 -0.71
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)