title: What does this line of code mean? .agg({'account':'count'}) | Aggregation & Pandas
body: <p>I am currently learning Python through the DataCamp Data Scientist Course and I came across a line of code that doesn't make sense to me.</p>
  <blockquote>
  <p>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)</p>
  </blockquote>
  <hr />
  <p><em>Below contains the datasets that you will need:</em></p>
  <p>licenses dataset:</p>
  <pre><code>     account ward  aid                   business                     address    zip
  0     307071    3  743       REGGIE'S BAR &amp; GRILL             2105 S STATE ST  60616
  1         10   10  829                 HONEYBEERS         13200 S HOUSTON AVE  60633
  2      10002   14  775                CELINA DELI           5089 S ARCHER AVE  60632
  3      10005   12  NaN  KRAFT FOODS NORTH AMERICA              2005 W 43RD ST  60609
  4      10044   44  638  NEYBOUR'S TAVERN &amp; GRILLE        3651 N SOUTHPORT AVE  60613
  </code></pre>
  <hr />
  <p>biz_owners dataset:</p>
  <pre><code>      account first_name  last_name           title
  0          10      PEARL    SHERMAN       PRESIDENT
  1          10      PEARL    SHERMAN       SECRETARY
  2       10002     WALTER     MROZEK         PARTNER
  3       10002     CELINA     BYRDAK         PARTNER
  4       10005      IRENE  ROSENFELD       PRESIDENT
  </code></pre>
  <hr />
  <p><em><strong>Start of the assignment</strong></em></p>
  <pre><code># Merge the licenses and biz_owners table on account
  licenses_owners = licenses.merge(biz_owners, on='account')
  </code></pre>
  <p><strong><strong>LINE OF CODE THAT I DON'T UNDERSTAND:</strong></strong></p>
  <pre><code># Group the results by title then count the number of accounts
  counted_df = licenses_owners.groupby('title').agg({'account':'count'})
  </code></pre>
  <p>What does the <code>.agg({'account':'count'})</code> part actually mean?</p>
  <p>In other words, how does this format give you this output?</p>
  <hr />
  <p><strong>WHAT I DO UNDERSTAND:</strong></p>
  <p>I understand the <code>.groupby()</code> operation and that <code>.agg()</code> is used as an operator over multiple values, but I have never seen aggregation formatted like this before.</p>
  <hr />
  <p><strong>Output</strong></p>
  <p>counted_df:</p>
  <pre><code>                    account
  title                      
  ASST. SECRETARY         111
  BENEFICIARY               4
  CEO                     110
  DIRECTOR                146
  EXECUTIVE DIRECTOR       10
  GENERAL PARTNER          21
  INDIVIDUAL              268
  LIMITED PARTNER          26
  MANAGER                 134
  MANAGING MEMBER         878
  </code></pre>
  <hr />
  <p>Thanks in advance!</p>