I have a dataframe 500 rows long by 4 columns. I need to find the proper python code that would divide the current row by the row below and then multiply that value by the value in the last row for every value in each column. I need to replicate this excel formula basically
- 积分
0 - 话题
0 - 评论
3124 - 注册排名
2531
It's not clear if your data is stored in an array as provided by Numpy, were it true you'd write, with the original data contained in
a
a[-1]
is the last row,a[:-1]
the array without the last row anda[+1:]
the array without the first (index zero, that is) row