A signup table records which plan each new user chose and which channel brought them in. You want three small summaries: how many users chose each plan, what share of all users that is, and how the plans split across the channels.
Write count_plans(df).
df has the text columns plan and channel, with one row per user. Nothing is missing and there is at least one row.
Return a tuple (counts, shares, table):
counts: a Series indexed by plan, holding the number of rows with that planshares: a Series indexed by plan, holding the fraction of all rows with that plan, a number between 0 and 1. The shares add up to 1.table: a DataFrame with one row per plan (the index) and one column per channel, where each cell is the number of users with that plan and that channel. A plan and channel that never occur together have a count of 0, not a missing value.counts and shares, and of the rows and columns of table, does not matter. The tests look values up by plan and channel.