-3
I am trying, from a csv table, to remove certain information that is not useful to me, but in the code there is an error, according to python 3, but I can not notice the error.
The error is on line 08, (file = open('salicapiprojetos02.csv', encoding = 'utf8')), with the following message: Syntaxerror: invalid syntax
Follows the code
import csv
import pandas as pd
arquivo_wri = open('projeto_dira.csv', mode='w', encoding = 'utf8')
arquivo_projeto = csv.writer(arquivo_wri, lineterminator = '\n')
arquivo_projeto.writerow(['nome', 'valor_captado', 'segmento', 'area']
**arquivo = open('salicapiprojetos02.csv', encoding = 'utf8')**
for registro in csv.DictReader(arquivo):
int(registro)
if registro['valor_captado'] != 0:
nome = registro['nome']
valor_captado = registro['valor_captado']
segmento = registro['segmento']
area = registro['area']
arquivo_projeto.writerow([nome, valor_captado, segmento, area])
arquivo_wri.close()
The parentheses of the
writerow
of the previous line?– Woss
Yes, Lucas! A mistake of mine! Thank you very much!
– c.kasmky