DataSet :
http://dados.recife.pe.gov.br/dataset/61545107-2e7d-4506-b9fa-f5264a7f6ec9/resource/d153f88e-3c25-422b-8b94-ef8d660bf7bf/download/acidentes-2016.csv
Database with traffic accidents in Recife Pernambuco from January to July 2016
are 1231 occurrences,
already with the libraries and the loaded project in IDE the function .shape for look how many tuples and I request the vision of the first 4 samples how .head( ).
Requesting list with the 10 neighborhoods where they had more accidents, and which vehicle involved we use the groupby () function grouping the neighborhoods and types of vehicles involved in the occurrences,All the information on the number of victims is already recognized as integer type so the value_counts () function is applied to count the victims involved
The 10 most critical days of the year:
Aggregate in the variable 'horas_acidentes' of the dataset using the 'data de abertura' column as the cluster parameter, this generates a vector of dates, this vector replicates the same date several times indicating the number of occurrences opened, the function .value_counts () simply will count how many times the date is peeled into the vector giving me the amount of occurrences. I apply the function .sort_values () by setting ascending = False to set the vector organized in a decreasing way, finally displaying the list by ordering the 10 dates with more occurrences quoted using .head(10)
Value_counts () function once again being used, to count the appearance of the words, this time using as column for the search the column 'tipo de ocorrencia'
Locais com mais acidentes
Plotando Gráfico dos locais com mais acidentes em 2016-Recife
Convertendo Datas e horas de String para tipo Data
Horários das ocorrências:
http://dados.recife.pe.gov.br/dataset/61545107-2e7d-4506-b9fa-f5264a7f6ec9/resource/d153f88e-3c25-422b-8b94-ef8d660bf7bf/download/acidentes-2016.csv
Database with traffic accidents in Recife Pernambuco from January to July 2016
are 1231 occurrences,
already with the libraries and the loaded project in IDE the function .shape for look how many tuples and I request the vision of the first 4 samples how .head( ).
Requesting list with the 10 neighborhoods where they had more accidents, and which vehicle involved we use the groupby () function grouping the neighborhoods and types of vehicles involved in the occurrences,All the information on the number of victims is already recognized as integer type so the value_counts () function is applied to count the victims involved
The 10 most critical days of the year:
Aggregate in the variable 'horas_acidentes' of the dataset using the 'data de abertura' column as the cluster parameter, this generates a vector of dates, this vector replicates the same date several times indicating the number of occurrences opened, the function .value_counts () simply will count how many times the date is peeled into the vector giving me the amount of occurrences. I apply the function .sort_values () by setting ascending = False to set the vector organized in a decreasing way, finally displaying the list by ordering the 10 dates with more occurrences quoted using .head(10)
Value_counts () function once again being used, to count the appearance of the words, this time using as column for the search the column 'tipo de ocorrencia'
Locais com mais acidentes
Plotando Gráfico dos locais com mais acidentes em 2016-Recife
Convertendo Datas e horas de String para tipo Data
Horários das ocorrências:
Ocorrências entre Janeiro e julho: