Good afternoon, guys!
I'm 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 executes successfully but when viewing the data the column names are correct, but in data lines only NaN are displayed.
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 numeric values? This file contains columns of quantitative and qualitative data.
Does anyone have an idea what it might be?
To access the data use this link link Failure Data Registered by the PRF
Thank you!
Léo