Pandas out yer ears
Run the cell below w/o changes to load tests
#run without changes
from test_background import pkl_dump, test_obj_dict, run_test_dict, run_test
Import:
-
Pandas under the alias 'pd'
-
Matplotlib.pyplot under the alias 'plt'
Run:
- %matplotlib inline
#Your code here
Make a dataframe by reading in the csv 'Chicago_Park_District__Movies_in_the_Parks_2019' which is in the "data" folder
#Your code here
#Your code here
Replace the truncated days of the week in the Days column with the full string of the day of the week using the Date column
#Your code here
#Your code here
#Your code here
#test your answer here
run_test(venue_max, 'venue_max')
#Your code here
#run this cell to test your answer
run_test(area_code, 'area_code')
(concept check: what type of object is this?)
Using movies_grp_day
, assign to movies_per_day
a series where the index is the day of the week and the values are total counts of movies per day
Again using movies_grp_day
, assign to unique_movies_per_day
a series where the index is the day of the week and the values are unique counts of movies per day of the week.
Use movies_per_day
and unique_movies_per_day
to calculate a series of how many movie showings per day of the week are of movies that are shown more than once. Assign this series to repeats
#Your code here
#test your answer here
run_test(repeats, 'repeats')
Which day of the week has the fewest underwriters? Run a calculation that results in a string (ie, don't run a calculation which displays the answer somewhere and then create a new string with the answer)
#Your code here
#test your answer here
run_test(day_underwriter_min, 'day_underwriter_min')
Using movies_grp_day
, assign the variable model_ratings_day
to a series where the index is the days of the week and the values are the modal rating for movies shown that day
Hint: look at the groupby documentation and write a function
#Your code here
#test your answer here
run_test(modal_ratings_day, 'modal_ratings_day')
Make a stacked bar chart showing the ratings of movies across days of the week using fig and ax objects
When you're done it should look like this (w/ figsize 8,5):
#Your code here