Session Ready
Exercise

Using other aggregations in pivot tables

You can also use aggregation functions within a pivot table by specifying the aggfunc parameter. In this exercise, you will practice using the 'count' and len aggregation functions - which produce the same result - on the users DataFrame.

Instructions
100 XP
  • Define a DataFrame count_by_weekday1 that shows the count of each column with the parameter aggfunc='count'. The index here is 'weekday'.
  • Print count_by_weekday1. This has been done for you.
  • Replace aggfunc='count' with aggfunc=len and verify you obtain the same result.