Trying to rename the column header on a dataframe before I write it to an excel sheet. The dataframe only has one column and I get this error when writing. The df will write just fine if I don't try to rename it.
AttributeError: 'NoneType' object has no attribute 'to_excel'
df2 = df2.rename(columns={'service_groups': 'Service Groups'}, inplace=True)
df2.to_excel(writer, sheet_name="Summary", startrow=0, startcol=start_column, index=False)```