In [83]:
import pandas as pd
pd.set_option('display.max_columns', 40)
pd.set_option('display.line_width', 400)
In [84]:
crashes = pd.read_csv('car_crashes_2007.csv')
In [85]:
crashes['Victim count'].sum()
Out[85]:
20888
In [86]:
crashes['Deaths'].sum()
Out[86]:
38
In [87]:
crashes[['Deaths', 'Serious Injuries', 'Injuries', 'Victim count']].sum()
Out[87]:
Deaths 38
Serious Injuries 457
Injuries 12213
Victim count 20888
dtype: int64
In [88]:
crashes['Intersection'].value_counts()
Out[88]:
PIE IX / JEAN TALON 23
SHERBROOKE / LAPOINTE 22
DECARIE / PARE 22
25 / TUNNEL LOUIS H LAFONTAINE 20
LANGELIER / METROPOLITAN 19
HENRI BOURASSA / TUNNEL LOUIS H LAFONTAINE 16
DE LORIMIER / ONTARIO 16
DECARIE / JEAN TALON 16
E / 15 15
S / SHERBROOKE 15
N / JEAN TALON 14
HENRI BOURASSA / BERRI 13
O / ST CHARLES 13
SHERBROOKE / TRICENTENAIRE 13
D'IBERVILLE / ST JOSEPH 12
...
NOTRE-DAME DE GRACE / OLD ORCHARD 1
O / STE ANNE 1
2E AVE / JEAN TALON 1
HALPERN / HENRI BOURASSA 1
RYAN / RENARD 1
COTE ST ANTOINE / MELROSE 1
STE CATHERINE / NICOLET 1
RENE LEVESQUE / CRESCENT 1
PAPINEAU / HENRI BOURASSA 1
GREENE / DORCHESTER 1
E / KM 58 0 1
E / PAPINEAU 1
BRUNSWICK / LAKE 1
PIE IX / 19E AVE 1
40 / IBERVILLE 1
Length: 3195, dtype: int64
In [89]:
crashes[crashes['Intersection'] == 'PIE IX / JEAN TALON']
Out[89]:
Address
Latitude
Cross Street
Street
Victim count
Injuries
Time
Serious Injuries
Date
Latitude.1
Deaths
Intersection
4
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
2
2
20:40
2
2007-01-01 00:00:00
45.554028
0
PIE IX / JEAN TALON
5
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
2
2
20:40
2
2007-01-01 00:00:00
45.554028
0
PIE IX / JEAN TALON
6
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
2
20:40
2
2007-01-01 00:00:00
45.554028
0
PIE IX / JEAN TALON
7
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
2
20:40
2
2007-01-01 00:00:00
45.554028
0
PIE IX / JEAN TALON
528
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
22:50
0
2007-01-28 00:00:00
45.554028
0
PIE IX / JEAN TALON
529
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
22:50
0
2007-01-28 00:00:00
45.554028
0
PIE IX / JEAN TALON
530
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
22:50
0
2007-01-28 00:00:00
45.554028
0
PIE IX / JEAN TALON
531
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
22:50
0
2007-01-28 00:00:00
45.554028
0
PIE IX / JEAN TALON
532
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
22:50
0
2007-01-28 00:00:00
45.554028
0
PIE IX / JEAN TALON
1644
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
1
23:20
0
2007-03-23 00:00:00
45.554028
0
PIE IX / JEAN TALON
1725
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
2
3
22:00
1
2007-03-27 00:00:00
45.554028
0
PIE IX / JEAN TALON
1726
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
3
22:00
1
2007-03-27 00:00:00
45.554028
0
PIE IX / JEAN TALON
1727
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
3
22:00
1
2007-03-27 00:00:00
45.554028
0
PIE IX / JEAN TALON
1728
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
3
22:00
1
2007-03-27 00:00:00
45.554028
0
PIE IX / JEAN TALON
2922
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
1
13:15
0
2007-05-30 00:00:00
45.554028
0
PIE IX / JEAN TALON
2991
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
18:53
0
2007-06-02 00:00:00
45.554028
0
PIE IX / JEAN TALON
2992
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
18:53
0
2007-06-02 00:00:00
45.554028
0
PIE IX / JEAN TALON
2993
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
18:53
0
2007-06-02 00:00:00
45.554028
0
PIE IX / JEAN TALON
2994
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
18:53
0
2007-06-02 00:00:00
45.554028
0
PIE IX / JEAN TALON
2995
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
5
18:53
0
2007-06-02 00:00:00
45.554028
0
PIE IX / JEAN TALON
3666
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
1
1:45
0
2007-07-01 00:00:00
45.554028
0
PIE IX / JEAN TALON
3773
7092 PIE IX , Montreal, Quebec
-73.589551
JEAN TALON
PIE IX
3
1
11:50
0
2007-07-06 00:00:00
45.565684
0
PIE IX / JEAN TALON
5928
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
3
1
12:00
0
2007-10-25 00:00:00
45.554028
0
PIE IX / JEAN TALON
In [71]:
crashes[:5]
Out[71]:
Address
Longitude
Cross Street
Street
Victim count
Injuries
Time
Serious Injuries
Date
Latitude
Deaths
0
5610 ST JACQUES , Montreal, Quebec
-73.606845
OXFORD
ST JACQUES
3
2
6:35
0
2007-01-01 00:00:00
45.467678
0
1
5610 ST JACQUES , Montreal, Quebec
-73.606845
OXFORD
ST JACQUES
3
2
6:35
0
2007-01-01 00:00:00
45.467678
0
2
ST LAURENT & RENE LEVESQUE, Montreal, Quebec
-73.682930
RENE LEVESQUE
ST LAURENT
3
2
7:23
0
2007-01-01 00:00:00
45.506962
0
3
ST LAURENT & RENE LEVESQUE, Montreal, Quebec
-73.682930
RENE LEVESQUE
ST LAURENT
3
2
7:23
0
2007-01-01 00:00:00
45.506962
0
4
PIE IX & JEAN TALON, Montreal, Quebec
-73.552521
JEAN TALON
PIE IX
2
2
20:40
2
2007-01-01 00:00:00
45.554028
0
Content source: jvns/talks
Similar notebooks: