Editing Community Data Science Course (Spring 2017)/Day 4 Notes
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 17: | Line 17: | ||
## Using <code>open</code> to open a file in python. | ## Using <code>open</code> to open a file in python. | ||
## In groups, explore one of these questions by building a histogram with a python dictionary: | ## In groups, explore one of these questions by building a histogram with a python dictionary: | ||
### | ### What kinds of values occur in <code>COLLISSIONTYPE</code>? | ||
### | ### What kinds of values occur in <code>ADDRTYPE</code>? | ||
### | ### What kinds of values occur in <code>JUNCTIONTYPE</code>? | ||
### | ### What kinds of values occur in <code>SDOT_COLDESC</code>? | ||
### | ### What kinds of values occur in <code>WEATHER</code>? | ||
### | ### What kinds of values occur in <code>SEVERITYDESC</code>? | ||
### (Challenge) Make a histogram of collisions by day in the data. Notice anything odd? | ### (Challenge) Make a histogram of collisions by day in the data. Notice anything odd? | ||
# Write transformation script and make a conclusion. You can work in groups. Example conclusions: | # Write transformation script and make a conclusion. You can work in groups. Example conclusions: | ||
Line 40: | Line 40: | ||
'''Code to open a file, select a subset of rows and columns, and write to a new file''' | '''Code to open a file, select a subset of rows and columns, and write to a new file''' | ||
file_handle = open('sdot_collisions_seattle.csv', 'r') # open the csv file | file_handle = open('sdot_collisions_seattle.csv', 'r') # open the csv file |