I have an excel sheet with below details

[]: 1st column - Case Number

[]:  2nd Column - Number of Players/Villains(N)

[]: 3rd to (3+N) Column - Energy of Players

[]: (3+N+1) to (3+2N) Column - Strength of Villains

Example:

1st column - Case Number - 1

2nd column - Number of Players/Villains - 3

3rd column to 6th column - Energy of 3 players

7th column to 9th column - strength of 3 Villains

Now I want to read this data in excel using Python.

I tried with __data = pd.read_excel('file-name')__

Case |No.of Player/Villain| Energy| Unnamed:3| Unnamed:4| Strength| Unnamed:6|
Unnamed:7

1    |       3            |   112 |   243    |   512    |   500   |   789    |
234

I need the merged header which is Energy of players/ strength of villains to be assigned to all the other columns which are now named as unnamed:3/4/6/7. Can someone suggest me how this can be done?

0 Answers