text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

crimes = pd.read_csv('../input/crime-in-los-angeles-data-from-2020-to-present/Crime_Data_from_2020_to_Present.csv')
crimes

crimes.drop(['DR_NO', 'Date Rptd', 'Rpt Dist No', 'Part 1-2', 'Mocodes', 'Crm Cd 1', 'Crm Cd 2', 'Crm Cd 3', 'Crm Cd 4', 'Cross Street', 'LOCATION'], axis=1, inplace=True)
crimes

crimes.isnull().sum()

crimes.dropna(axis=0, inplace=True)
crimes.reset_index(drop=True, inplace=True)
crimes

crimes_desc = crimes[['Crm Cd Desc', 'Premis Desc', 'Weapon Desc', 'Status Desc']]
crimes = crimes[['YEAR OCC', 'MONTH OCC', 'DAY OCC', 'TIME OCC', 'AREA', 'AREA NAME', 'Crm Cd', 'Vict Age', 'Vict Sex', 'Vict Descent', 'Premis Cd', 'Weapon Used Cd', 'Status']]
crimes

crimes_distribution = crimes.iloc[:, [1, 2, 3, 4, 6, 7, 10, 11]]
crimes_distribution

fig, axs = plt.subplots(nrows=2, ncols=4, figsize=(20, 10))
for i, feature in enumerate(crimes_distribution.columns):
    row = int(i / 4)
    col = i % 4
    sns.distplot(crimes_distribution.iloc[:, i], ax=axs[row][col])
plt.suptitle('Distirbution of features')
plt.tight_layout