1import pandas as pd
2
3list1 = [1,2,3,4,5]
4df = pd.DataFrame(list1)
5df.to_csv('filename.csv', index=False)
6
7#index =false removes unnecessary indexing/numbering in the csv
1import csv
2
3with open("out.csv", "w", newline="") as f:
4 writer = csv.writer(f)
5 writer.writerows(a)
1open('file.csv', 'r').read().splitlines() #assuming you want each row to be an individual element in the list