Jovian
⭐️
Sign In

importing libraries

In [1]:
import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import jovian as jvn
sns.set(style="darkgrid")

Commiting the notebook to Jovian

In [ ]:
jvn.commit()
[jovian] Saving notebook..

importing data

In [2]:
path = "/Users/manku/Documents/Development/jupyter/datasets/crimes-in-boston/crime.csv"
df = pd.read_csv(path, encoding = "ISO-8859-1")

investigating the data to check if it's actually imported

In [3]:
df.head()
Out[3]:
In [4]:
df.tail()
Out[4]:
In [5]:
len(df)
Out[5]:
319073
In [6]:
df.dtypes
Out[6]:
INCIDENT_NUMBER         object
OFFENSE_CODE             int64
OFFENSE_CODE_GROUP      object
OFFENSE_DESCRIPTION     object
DISTRICT                object
REPORTING_AREA          object
SHOOTING                object
OCCURRED_ON_DATE        object
YEAR                     int64
MONTH                    int64
DAY_OF_WEEK             object
HOUR                     int64
UCR_PART                object
STREET                  object
Lat                    float64
Long                   float64
Location                object
dtype: object

Plotting with matplotlib

Plotting a graph of types of crime in a year based on OFFENCE_CODE_GROUP and YEAR
Plot a grpah using Reporting_AREA and OFFENCE_CODE_GROUP use count

Having troubles here on how to plot and what to plot