We want you to produce a new DataFrame that contains the only following columns:
Ensure that all first names are title cased. Do not include any records that have a missing last name, and make sure that their email is verified (email_verified
should be set True). Sort by last name and then by first.
Choose Kernel > Restart & Run all
to run the tests properly.
# Setup
import os
import pandas as pd
from utils import make_chaos
from tests.helpers import check
pd.options.display.max_rows = 10
users = pd.read_csv(os.path.join('data', 'users.csv'), index_col=0)
# Pay no attention to the person behind the curtain
make_chaos(users, 19, ['first_name'], lambda val: val.lower())
## CHALLENGE - Verified email list ##
# TODO: Narrow list to those that have email verified.
# The only columns should be first, last and email
email_list = users[:]
# TODO: Remove any rows missing last names
# TODO: Ensure that the first names are the proper case
# Return the new sorted DataFrame..last name then first name ascending
email_list
check(__name__, 'Verified email list')