I have an excel file. It has columns without a name. This columns are the next instance of the last named column. I would the columns without a name to be named after the last named column a counter of how many empty columns there were since the last named one.
I have something like this:
If I just read the .csv normally I get:
a b Unnamed: 2 Unnamed: 3 c Unnamed: 5 d
0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1
4 1 1 1 1 1 1 1
So I read with header=None, than I get the columns in the first row, where I can use ffill to fill them like I wish. The only I still want to add is a counter.
I would want my output to be like:
a b0 b1 b2 c0 c1 d
0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1
4 1 1 1 1 1 1 1