使用Python在Excel中读取合并标题

时间:2019-05-04 05:21:58

标签: excel python-3.x

我有一个具有以下详细信息的Excel工作表

[]: 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

示例:

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

现在,我想使用Python在excel中读取此数据。

我尝试过__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

我需要将合并的标头(即球员的能量/恶棍的力量)分配给所有其他未命名的列:3/4/6/7。有人可以建议我该怎么做吗?

0 个答案:

没有答案