0

I have a dictionary with multiple values to a key. For ex:

dict = {u'Days': [u'Monday', u'Tuesday', u'Wednesday', u'Thursday'],u'Temp_value':[54,56,57,45], u'Level_value': [30,34,35,36] and so on...}

I want to export this Data to excel in the below-mentioned formet.

Column 1   Column 2      column 3      so on...
Days       Temp_value    Level_value
Monday     54            30
Tuesday    56            34
Wednesday  57            35
Thursday   45            36

How can I do that?

1 Answers1

0

Use pandas

import pandas as pd
df = pd.DataFrame(your_dict)
df.to_excel('your_file.xlsx', index=False)
Teshan Shanuka J
  • 1,448
  • 2
  • 17
  • 31