2
Good afternoon Personal!
I am trying to import a csv file using the pandas package in Python
import pandas as pd
names_col = ['AnoInfracao',
'TrimestreInfracao',
'CodigoInfracao',
'DescricaoAbreviadaInfracao',
'Gravidade',
'DescricaoTipoVeiculo',
'DescricaoEspecie',
'UF',
'Municipio',
'BR',
'KM',
'NacionalidadeVeiculo']
data = pd.read_csv("C:\\Pasta\\pasta1\\Documents\\PRF_DADOS_ABERTOS_INFRACOES_2015_T4\\PRF_DADOS_ABERTOS_INFRACOES_2015_T4.csv", delimiter=';',header=None, names=names_col,skiprows=1,dtype={'AnoInfracao':'category'})
The command runs successfully but when viewing the data the column names are correct, but in the data rows only Nan is shown.
AnoInfracao TrimestreInfracao CodigoInfracao DescricaoAbreviadaInfracao
0 NaN NaN NaN NaN
1 NaN NaN NaN NaN
2 NaN NaN NaN NaN
3 NaN NaN NaN NaN
4 NaN NaN NaN NaN
Does the pandas package only import numerical values? This file has columns of quantitative and qualitative data.
Does anyone have any idea what it might be?
To access the data use this link http://www1.prf.gov.br/arquivos/index.php/s/sRa6yPSftGN7BMP/download Infringement Data Registered by PRF
Thank you very much!
Leo
If this data is numerical and the pandas package "only matters numerical values" maybe it is better to go another way
– Miguel
If you look good is a question and not statement friend. :)
– LeoGallerDev
I’m sorry, I didn’t notice, distraction
– Miguel
No problem, it happens. :)
– LeoGallerDev