I'm trying to write to an Excel file using Python and the xlrd module, with the following code:
Table = [ 'baseMax - 1cm', 'baseMin- 1cm',
'baseMax - 5cm', 'baseMin - 5cm',
'baseMax - 15cm' 'baseMin - 15cm'
]
new_base = { 'baseMax - 1cm': [], 'baseMax - 5cm': [],
'baseMax - 15cm': [], 'baseMin- 1cm': [],
'baseMin - 5cm': [], 'baseMin - 15cm': []
}
HeadName = 'Base Calculation'
for i in Table:
base_stats.write(ROW, 0, HeadName + ' ' + i + ' - ')
base_stats_stats.write(ROW, 1, new_base[i])
ROW = ROW+1
ROW = ROW+1
When I run this code I get an error at new_base[i]. I'm not sure I understand exactly what this error is about. It appears to have to do with the parameters I'm passing, but I don't really understand it.
raise Exception("Unexpected data type %r" % type(label))
Exception: Unexpected data type <type 'list'>