Hello Please, I have a pandas.core.frame.DataFrame with these columns, in Python3:
Estado 150 non-null object
Cargo 150 non-null object
Nome_candidato 150 non-null object
CPF 150 non-null int64
Nome_urna 150 non-null object
Partido 150 non-null object
Situacao 150 non-null object
Avaliacao 130 non-null object
Projeto 150 non-null object
Link 72 non-null object
Autor_1 150 non-null object
Autor_1_limpo 150 non-null object
Autor_2 6 non-null object
Autor_2_limpo 6 non-null object
Autor_3 1 non-null object
Autor_3_limpo 1 non-null object
Autor_4 1 non-null object
Tipo 150 non-null object
Fonte 150 non-null object
I want to create a list with only the contents of the Project column. I did so:
projetos_eleitos = []
for i in autor1:
valor_projeto = i.Projeto
projetos_eleitos.append([valor_projeto])
With this error:
AttributeError Traceback (most recent call last)
<ipython-input-32-c6845dcc0293> in <module>()
1 for i in autor1:
----> 2 valor_projeto = i.Projeto
3 projetos_eleitos.append([valor_projeto])
4
AttributeError: 'str' object has no attribute 'Projeto'
Does anyone know what the error is?