I have a CSV file with more than 9000 lines. I need to get a list with just one die from each line.
An example is as follows:
01/02/19,carlos,casa,rio
03/05/18,luis,carro,maceio
06/04/17,camila,celular,teresina
I need to get a list with just the names:
lista = ['carlos','luis','camila']
As close as I got to this code:
csvRows=[]
arq_contas = open ('C:.../lista_contas.csv')
leitura_contas = csv.reader(arq_contas,delimiter=',', lineterminator='\n')
for row in leitura_contas:
csvRows.append(row[1:2])
print(csvRows)
but I got the following result:
['carlos'], [], ['luis'], [], ['camila'], [],
I'm a beginner in Python and programming with a whole. So I need a light from you.