赞
踩
作用是后移一个位置。具体如下:
a=pd.DataFrame({‘guangdong’:[2001,1002,2003],‘gansu’:[1,2,3],‘lilei’:[2002,2003,2004]},index=range(3))
a
guangdong gansu lilei
0 2001 1 2002
1 1002 2 2003
2 2003 3 2004a.shift(1)
guangdong gansu lilei
0 NaN NaN NaN
1 2001.0 1.0 2002.0
2 1002.0 2.0 2003.0
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。