'pandas Read excel sheet multiple header loosing headers
I have an excel sheet with multiple headers
_________________________________________________________________________
____|_____| Header1 | Header2 | Header3 |
ColX|ColY |ColA|ColB|ColC|ColD||ColD|ColE|ColF|ColG||ColH|ColI|ColJ|ColDK|
1 | ds | 5 | 6 |9 |10 | .......................................
2 | dh | ..........................................................
3 | ge | ..........................................................
4 | ew | ..........................................................
5 | er | ..........................................................
I want to split this into 3 tables. However, when I try
df1=df["Header1"]
the ColA, ColB and ColD strings are all dropped.
so df1 looks like
______________________________
ColX|ColY | | |ColC| |
1 | ds | 5 | 6 |9 |10 |
2 | dh | .................|
3 | ge | .................|
4 | ew | .................|
5 | er | .................|
I'm not sure what is going on.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
