text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

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

import seaborn as sns

df = pd.read_csv('/kaggle/input/gun-violence-data/gun-violence-data_01-2013_03-2018.csv')

p_null = (len(df) - df.count()) * 100.0 / len(df)
p_null

train = df[['date', 'state', 'city_or_county', 'address', 'n_killed', 'n_injured']]
df.isnull().any()

state = df['state'].value_counts()
sns.despine(left=True, right=True)

state = df['city_or_county'].value_counts()[:20]
sns.despine(left=True, right=True)

year_wise = df[['n_killed', 'n_injured']].groupby(df['year']).sum()
density_plot = sns.kdeplot(year_wise['n_killed'], shade=True, color='red')
density_plot = sns.kdeplot(year_wise['n_injured'], shade=True, color='blue')
print(year_wise['n_killed'])
sns.distplot(year_wise['n_killed'], hist=False, rug=True)