Exercise

One-to-many merge

A business may have one or multiple owners. In this exercise, you will continue to gain experience with one-to-many merges by merging a table of business owners, called biz_owners, to the licenses table. Recall from the video lesson, with a one-to-many relationship, a row in the left table may be repeated if it is related to multiple rows in the right table. In this lesson, you will explore this further by finding out what is the most common business owner title. (i.e., secretary, CEO, or vice president)

The licenses and biz_owners DataFrames are loaded for you.

Instructions

100 XP
  • Starting with the licenses table on the left, merge it to the biz_owners table on the column account, and save the results to a variable named licenses_owners.
  • Group licenses_owners by title and count the number of accounts for each title. Save the result as counted_df
  • Sort counted_df by the number of accounts in descending order, and save this as a variable named sorted_df.
  • Use the .head() method to print the first few rows of the sorted_df.