my_dataframe.to_excel(writer, startrow=1, sheet_name='Sheet1', index=False)
workbook = writer.book
worksheet = writer.sheets['Sheet1']
columns = len(my_dataframe.columns)
column_series = pd.Series(list(range(columns)))
column_list = column_series.tolist()
for i in column_list:
    column_len = my_dataframe[[i]].astype(str).apply(lambda x: x.str.len()
        ).max().max()
worksheet.set_column(i, i, column_len)
writer.save()
Is there a way to auto-adjust Excel column widths with pandas.ExcelWriter?