1import numpy as np
2np.savetxt('data.csv', (col1_array, col2_array, col3_array), delimiter=',')
1header = [re.sub(' +',' ',i[0][:-1].replace('\n', ' ')) for i in optionsTable[0]]
2
3with open('test.csv', 'w') as fp:
4 writer = csv.writer(fp, delimiter=',')
5 writer.writerow(header)
6 for row in optionsTable:
7 writer.writerow([i[1] for i in row])
8
9#Credit to https://stackoverflow.com/users/790387/burhan-khalid Burhan Khalid
10#On StackOverflow.