How do I export a two dimensional list in Python to excel?
Question: I have a list that looks like this:

    
    
    [[[u'example', u'example2'], [u'example', u'example2'], [u'example', u'example2'], [u'example', u'example2'], [u'example', u'example2']], [[5.926582278481011, 10.012500000000001, 7.133823529411763, 8.257352941176471, 7.4767647058823545]]]
    

I want to save this list to an Excel file in the following way:

Column 1: [example, example, ..., example]

Column 2: [example2, example2, ..., example2]

Column 3: [5.926582278481011, 10.012500000000001, ..., 7.4767647058823545]


Answer: Please use below link to explore different ways:

<http://www.python-excel.org/>

xlwt is one of the ways:

<http://xlwt.readthedocs.io/en/latest/>

<https://yuji.wordpress.com/2012/04/19/python-xlwt-writing-excel-files/>

If you want to use xlwt then below is the code:

    
    
    import xlwt
    workbook = xlwt.Workbook()
    sheet = workbook.add_sheet("Sheet")
    
    for i in range(len(rows)):
        for j in range(len(rows[i])):
            sheet.write(i, j, rows[i][j])
    
    workbook.save("test.xls")
    

You have to install xlwt first if you want to use above code. For more
information please refer xlwt documentation.

