Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Dave Foote
/
CAPP30254-1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5f8fe9fe
authored
Apr 07, 2019
by
Dave Foote
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not sure what the best way to lay this out is
parent
4ce3f49b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
pa1.py
pa1.py
View file @
5f8fe9fe
...
...
@@ -42,19 +42,19 @@ df_17 = create_df(get_full_dataset(id_17))
df_18
=
create_df
(
get_full_dataset
(
id_18
))
#summary statistics:
print
(
'
5 Most Common Chicago Crimes in 2017:
'
,
df_17
.
primary_type
.
value_counts
()
.
head
())
print
(
'
5 Most Common Chicago Crimes in 2018:
'
,
df_18
.
primary_type
.
value_counts
()
.
head
())
print
(
'
5 Wards with Highest Volume of Crime in 2017:
'
,
df_17
.
ward
.
value_counts
()
.
head
(
))
print
(
'
5 Wards with Highest Volume of Crime in 2018:
'
,
df_18
.
ward
.
value_counts
()
.
head
(
))
print
(
'
10 Most Common Chicago Crimes in 2017:
\n
'
,
df_17
.
primary_type
.
value_counts
()
.
head
(
10
))
print
(
'
10 Most Common Chicago Crimes in 2018:
\n
'
,
df_18
.
primary_type
.
value_counts
()
.
head
(
10
))
print
(
'
10 Neighborhoods with Highest Volume of Crime in 2017:
\n
'
,
df_17
.
community_area
.
value_counts
()
.
head
(
10
))
print
(
'
10 Neighborhoods with Highest Volume of Crime in 2018:
\n
'
,
df_18
.
community_area
.
value_counts
()
.
head
(
10
))
arrest_rates_17
=
df_17
.
arrest
.
value_counts
()
arrest_rates_18
=
df_18
.
arrest
.
value_counts
()
print
(
'Arrests Per Stop in 2017:
'
,
(
arrest_rates_17
[
1
]
/
arrest_rates_17
[
0
]))
print
(
'Arrests Per Stop in 2018:
'
,
(
arrest_rates_18
[
1
]
/
arrest_rates_18
[
0
]))
print
(
'Arrests Per Stop in 2017:
\n
'
,
(
arrest_rates_17
[
1
]
/
arrest_rates_17
[
0
]))
print
(
'Arrests Per Stop in 2018:
\n
'
,
(
arrest_rates_18
[
1
]
/
arrest_rates_18
[
0
]))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment