Skip to content Skip to sidebar Skip to footer

Adding An Extra Column To The Combined/merged Excel Files

I am wondering how it is possible to add an extra column, to the combined/merged Excel files (see also my previous question). The Excel files look like: What I have is: import xlw

Solution 1:

You have to use a multiIndex.

data.index = pd.MultiIndex.from_tuples([(team_name,team_code)] * len(data))

also to avoid the team_name cells from merging you can use

df.to_excel("C:\\Kids\\combined2.xls",merge_cells = False)

Post a Comment for "Adding An Extra Column To The Combined/merged Excel Files"