Попробуйте этот код.Работает отлично!
# Writing to an excel
# sheet using Python
import xlwt
from xlwt import Workbook
# Workbook is created
wb = Workbook()
#dictionary
sample_data= {
'Australia Central 2': 0.0097,
'East US 2': 0.00605,
'North Central US': 0.00605,
'South Africa West': 0.01016,
'UK West': 0.00685,
'France South': 0.01119,
'Korea': 0.00639,
'Canada East': 0.00685,
'US Gov Virginia': 0.00879,
'East Asia': 0.0097,
'South India': 0.01005,
'South Central US': 0.00731,
'West US': 0.00719,
'Australia East': 0.00776,
'Canada Central': 0.00674,
'Australia Southeast': 0.00776,
'Southeast Asia': 0.00776,
'Central US': 0.00731,
'West India': 0.00833,
'East US': 0.00605,
'Australia Central': 0.0097,
'UK South': 0.00685,
'Japan East': 0.00799,
'Japan West': 0.00879,
'West Europe': 0.00696,
'Brazil South': 0.00982,
'Korea Central': 0.00799,
'US Gov Texas': 0.00879,
'US Gov Arizona': 0.00879,
'Central India': 0.00833,
'North Europe': 0.00822,
'West Central US': 0.00731,
'France Central': 0.00856,
'South Africa North': 0.00811,
'West US 2': 0.00605
}
# add_sheet is used to create sheet.
sheet1 = wb.add_sheet('Sheet 1')
#general syntax
#sheet1.write(column, row, value)
sheet1.write(0, 0, 'Key')
sheet1.write(1, 0, 'Hourly')
row = 1
#iterate the each key-value pair of dictionary & insert into sheet
for k, v in dict.items():
sheet1.write(0, row, k)
sheet1.write(1, row, v)
row = row + 1
wb.save('xlwt example.xls')