a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
ar = array(a)
import csv
fl = open('filename.csv', 'w')
writer = csv.writer(fl)
writer.writerow(['label1', 'label2', 'label3'])
for values in ar:
    writer.writerow(values)
fl.close()
how to write python array (data = []) to excel?