I'm tring to collect some data from my db, and using pandas to make a excel file. The dataframe structure I got like below:
>>> df 2020-05-21~2020-05-27 input_cost jim bob companyc 17770.65 17770.65 companye 3392.73 3392.73 companyd 2892.30 2892.30 companyf 22843.67 22843.67 casy dave company_a 160.93 160.93 company_b 160.93 160.93 And then I want to add a header to it , then export it to excel file by using df.to_excel
# expected output date data_source sale leader entity_name 2020-05-21~2020-05-27 sum input_cost jim bob companyc 17770.65 17770.65 companye 3392.73 3392.73 companyd 2892.30 2892.30 companyf 22843.67 22843.67 casy dave company_a 160.93 160.93 company_b 160.93 160.93 Sorry that I'm a new bee to pandas, how can I make it work?
Thanks.