I have a problem. I wanna to store each column from .csv file into list. So if I have csv file like that https://i.stack.imgur.com/WuRyt.png
And I want to store it in the way that:
ColumnA = [50-001, 50-002, 50-003, 50-004, 50-005, 50-006, 50-007, 50-008, 50-009]
ColumnB = [85-001, 85-003, 85-004 , 85-004 ,85-004 , 85-005 ,85-005, 85-006 ,85-007]
etc.
I have for now something like that, but it's store each row to list, but I need each column to the list. Can someone help me? I also tried with pandas, and also I can't do that.
csvfile = open('Kody pocztowe csv.csv', 'r')
csv1 = csv.reader(csvfile,delimiter = ',')
sort = sorted(csv1, key=operator.itemgetter(0))
for eachline in sort:
print(eachline)
csvfile.readline()
lx = []
for line in csvfile:
row = line.split(',')
lx.append(row)
print(lx)