Skip to content

Instantly share code, notes, and snippets.

@anapaulagomes
Last active June 24, 2020 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anapaulagomes/dcf146430030aa62e168f8f4696944f3 to your computer and use it in GitHub Desktop.
Save anapaulagomes/dcf146430030aa62e168f8f4696944f3 to your computer and use it in GitHub Desktop.
Filtra dados do Auxílio Emergencial por Código do Município no IBGE
import csv
with open('202005_AuxilioEmergencial.csv', newline='', encoding="ISO-8859-1") as csvfile:
spamreader = csv.DictReader(csvfile, delimiter=';')
header = next(spamreader)
writer = csv.DictWriter(open('202005_AuxilioEmergencial-Feira.csv', 'w'), fieldnames=header)
for row in spamreader:
if row["CÓDIGO MUNICÍPIO IBGE"] == "2910800":
writer.writerow(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment