I have the table like this:
import pandas as pd
data = [[20, 15, 10, 5], [20, 15, 10, 5], [20, 15, 10, 5], [20, 15, 10, 5]]
df = pd.DataFrame(data, columns = ['one', 'two', 'three', 'four'])
df
| one | two | three | four |
|---|---|---|---|
| 20 | 15 | 10 | 5 |
| 20 | 15 | 10 | 5 |
| 20 | 15 | 10 | 5 |
| 20 | 15 | 10 | 5 |
I want to move every rows values left according their rows index. Row values with index 0 stays the same, Row values with index 1 moves left in one point, Row values with index 2 moves left in two points, etc... Desired table should looks like this:
| one | two | three | four |
|---|---|---|---|
| 20 | 15 | 10 | 5 |
| 15 | 10 | 5 | 0 |
| 10 | 5 | 0 | 0 |
| 5 | 0 | 0 | 0 |
Thanks for helping me!