Syntax error while reading CSV file

-3

I'm 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 figure out the error.

  

The error is on line 08, (file = open ('salicapiprojetos02.csv',   encoding = 'utf8')), with the following message: SyntaxError: invalid   syntax

Follow 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()
    
asked by anonymous 06.04.2018 / 21:59

1 answer

1

Hello!

The problem is this line actually:

arquivo_projeto.writerow(['nome', 'valor_captado', 'segmento', 'area']        

It's missing closing the ")".

    
10.04.2018 / 01:37