I have a table:
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 = ['asd', 'bsd', 'tsd', 'pzd'])
df
| asd | bsd | tsd | pzd | ... |
|---|---|---|---|---|
| 20 | 15 | 10 | 5 | ... |
| 20 | 15 | 10 | 5 | ... |
| 20 | 15 | 10 | 5 | ... |
| 20 | 15 | 10 | 5 | ... |
I want to rename all my column names with the pattern like this 'param'+ (index_column +1) through the loop
Desired output:
| param1 | param2 | param3 | param4 | ... |
|---|---|---|---|---|
| 20 | 15 | 10 | 5 | ... |
| 20 | 15 | 10 | 5 | ... |
| 20 | 15 | 10 | 5 | ... |
| 20 | 15 | 10 | 5 | ... |
Thanks
df = pd.DataFrame(data, columns = ['param1','param2','param3','param4'])