This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# REMOVENDO DADOS DUPLICADOS | |
def removeDuplicados(df): | |
df.drop_duplicates(inplace=True) | |
return df | |
all_data = removeDuplicados(all_data) | |
# FILTRANDO DADOS DE S.PAULO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FUNÇÃO PARA IMPORTAR DATASET | |
dir_path = "data/" | |
def importaData(files): | |
data = dir_path + files | |
allFiles = glob.glob('data/*.csv') | |
list_ = [] | |
cols = ['ANO_BO', 'DATAOCORRENCIA', 'PERIDOOCORRENCIA', 'BAIRRO', 'CIDADE', 'LATITUDE', 'LONGITUDE', 'LOGRADOURO', \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd # Manipulação de dados | |
import glob # Importação de dados | |
import re # Expressões regulares | |
import itertools # Ferramenta iteração | |
import numpy as np # Computação científica | |
import statsmodels.api as sm # Modelagem estatística | |
import seaborn as sns # Visualização de dados | |
import squarify # Visualização de treemaps | |
import matplotlib.pyplot as plt # Visualização de dados |