0
I’m a beginner in Python and I’m having a hard time.
I have a CSV database separated by ";" with 6 columns. I’d like to count how many records you have, the sex of which is "Female". You can tell me how to do it or where to start my studies?
Below is the code I have so far.
import csv
with open('teste.csv', 'r') as arquivo:
delimitador = csv.Sniffer().sniff(arquivo.read(1024), delimiters=";")
arquivo.seek(0)
leitor = csv.reader(arquivo, delimitador)
dados = list(leitor)
for x in dados:
print(x)
I converted it into a list, but I couldn’t think of a way to check for "female" in the line.
Any tips for beginner will also be welcome.
Thanks for the answer. For now, only if "Female" inside the for already suits me, is a simple algorithm. Vlw
– Matheus Macedo
You are welcome to reply @Matheusmacedo: https://pt.meta.stackoverflow.com/questions/1078/como-e-por-que-aceitar-uma-reply
– Miguel