How to shift columns in a Pandas Dataframe?

后端 未结 0 1021
無奈伤痛
無奈伤痛 2021-01-15 14:45

I would like to substract every column in my Dataframe by the column next to it, like this:

for l in list:
    df[l] = df[l].sub(df[l].shift(axis = 1))


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题