How to change column type in pandas?

2

Please in Python 3 and Pandas, I want to change the type of a column from a CSV file. I used this command:

cand_doacoes ['CPF_CNPJ_doador'] = cand_doacoes.CPF_CNPJ_doador.astype (int64)

But the error appears:

NameError Traceback (most recent call last)  in () ---- > 1 cand_doacoes ['CPF_CNPJ_doador'] = cand_doacoes.CPF_CNPJ_doador.astype (int64)

NameError: name 'int64' is not defined

Does anyone know the correct command?

    
asked by anonymous 04.10.2017 / 15:40

1 answer

1

I made some tests and if it is informed 'int64' in quotation marks (string) and conversion happens without problems.

cand_doacoes.CPF_CNPJ_doador.astype('int64')
    
04.10.2017 / 16:01