I have an existing excel file in documents which I open as a data frame with df = pd.read_excel(filename, index_col ='respID')
and then I read and treat as a normal data frame.
I process some data and I then have two dictionaries whose key values are the same as the index values of the data frame.
I'm looking to insert these dictionaries into the excel file after a specific column. How would I go about doing this. Would it be better if they were just series?
I've seen solutions How to write to an existing excel file without overwriting data (using pandas)? and Pandas Series to Excel but I don't think either answers my question totally.
Worst comes to worst I can add the dictionaries to the data frame where I want them and just overwrite the entire excel file or write a new one and replace it but that seems inelegant.
Thank you.