text_plain_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df1 = pd.read_csv('../input/atlanta-crime-data2020/COBRA-2020-OldRMS-09292020 (Corrected 11_25_20)/COBRA-2020-OldRMS-09292020.csv')
df2 = pd.read_csv('../input/atlanta-crime-data2020/COBRA-2020 (Updated 12_10_2020)/COBRA-2020.csv')
df3 = pd.read_csv('../input/atlanta-crime-data2020/COBRA-2009-2019 (Updated 1_9_2020)/COBRA-2009-2019.csv')

df1 = df1.drop(columns=['apartment_office_prefix', 'apartment_number', 'watch', 'location_type', 'UCR_Number'])
df2 = df2.drop(columns=['ibr_code'])
df3 = df3.drop(columns=['Apartment Office Prefix', 'Apartment Number', 'Shift Occurence', 'Location Type', 'UCR #', 'IBR Code'])

df3.columns = df1.columns

df3 = df3[df3['occur_time'].apply(lambda x: str(x).isdecimal())]

df3 = df3[df3['occur_hour'].apply(lambda x: str(x).isnumeric())]

keys = df1.columns
df1 = df1.dropna(subset=keys).reset_index(drop=True)
df2 = df2.dropna(subset=keys).reset_index(drop=True)
df3 = df3.dropna(subset=keys).reset_index(drop=True)

df = pd.concat([df1, df2, df3]).reset_index(drop=True)

df.to_csv('df.csv', index=False)

df = df.astype({'occur_year': 'int32', 'occur_month': 'int32', 'occur_day': 'int32', 'occur_hour': 'int32', 'rpt_year': 'int32', 'rpt_month': 'int32', 'rpt_day': 'int32'})

df['neighborhood'].value_counts()