Homework 1 — Python Coding for Public Policy
Homework 1
Contents
Coding: Exploring Trends in How People Submit 311 Requests
Tutorials
Participation
General assignment information
Coding: Exploring Trends in How People Submit 311 Requests
Use this zipped copy of the cleaned data created in the lecture to complete the homework.
Read it in from:
https://storage.googleapis.com/python-public-policy2/data/311_requests_2018-19_sample_clean.csv.zip
You will get a DtypeWarning - donʼt worry about that for now.
# your code here
Step 0
Which complaint submission method ( Open Data Channel Type ) is used most frequently, according to this dataset? Provide the count of each for comparison.
# your code here
Step 1
Get the count of each submission method per complaint type, sorted by complaint type.
# your code here
Review the results and share a sentence or two with your observations.
YOUR RESPONSE HERE
Step 2
Provide a simplified table that only lists the most common request submission method for each complaint type. There should be one row per complaint type, capturing the most common submission method for that complaint type.
# your code here
Can you provide a potential explaination for why some complaints are more frequently made via phone and mobile versus on the website?
YOUR RESPONSE HERE
Now turn in the assignment.
Tutorials
1. Read The Joys (and Woes) of the Craft of Software Engineering
Note not everything in there is applicable to data analysis
2. Filtering/indexing DataFrame. s
Filter specific rows from a DataFrame.
Boolean indexing
3. Learn about functions
Video
4. Coding Style. Guides - Please skim these; I donʼt expect you to understand and follow everything in them. The most important guidelines to pay attention to are indentation and keeping each statement on its own line.
The Hitchhikerʼs Guide to Python
PEP 8
5. Guide to commenting your code
6. Quartz Guide to Bad Data
Optional
Learn about data dictionaries
Glance through pandasʼ comparison with other tools for any you are familiar with
More on indexing:
How to Select Rows from Pandas DataFrame.
Selecting Subsets of Data in Pandas: Part 1 and Part 2
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。