Premium problem151. Count Email Domains

Easy Locked

users has columns user_id and email.

Take the part of each address after the @ as the domain and return a DataFrame with columns domain and users, counting how many accounts use each one. Sort by users descending then domain alphabetically, and renumber the index from 0.

Input

   user_id          email
0        1  a@example.com
1        2  b@example.com
2        3     c@mail.org
3        4       d@zed.io

Output

        domain  users
0  example.com      2
1     mail.org      1
2       zed.io      1

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)