{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Optional Challenge - Verified Email List\n", "\n", "We want you to produce a new DataFrame that contains the only following columns:\n", "* first_name\n", "* last_name\n", "* email\n", "\n", "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.\n", "\n", "Choose `Kernel > Restart & Run all` to run the tests properly. \n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Setup\n", "import os\n", "\n", "import pandas as pd\n", "\n", "from utils import make_chaos\n", "\n", "from tests.helpers import check\n", "\n", "pd.options.display.max_rows = 10\n", "users = pd.read_csv(os.path.join('data', 'users.csv'), index_col=0)\n", "# Pay no attention to the person behind the curtain\n", "make_chaos(users, 19, ['first_name'], lambda val: val.lower())" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | first_name | \n", "last_name | \n", "email_verified | \n", "signup_date | \n", "referral_count | \n", "balance | \n", "|
---|---|---|---|---|---|---|---|
aaron | \n", "Aaron | \n", "Davis | \n", "aaron6348@gmail.com | \n", "True | \n", "2018-08-31 | \n", "6.0 | \n", "18.14 | \n", "
acook | \n", "Anthony | \n", "Cook | \n", "cook@gmail.com | \n", "True | \n", "2018-05-12 | \n", "2.0 | \n", "55.45 | \n", "
adam.saunders | \n", "Adam | \n", "Saunders | \n", "adam@gmail.com | \n", "False | \n", "2018-05-29 | \n", "3.0 | \n", "72.12 | \n", "
adrian | \n", "Adrian | \n", "Yang | \n", "adrian.yang@teamtreehouse.com | \n", "True | \n", "2018-04-28 | \n", "3.0 | \n", "30.01 | \n", "
adrian.blair | \n", "Adrian | \n", "Blair | \n", "adrian9335@gmail.com | \n", "True | \n", "2018-06-16 | \n", "7.0 | \n", "25.85 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
wilson | \n", "Robert | \n", "Wilson | \n", "robert@yahoo.com | \n", "False | \n", "2018-05-16 | \n", "5.0 | \n", "59.75 | \n", "
wking | \n", "Wanda | \n", "King | \n", "wanda.king@holt.com | \n", "True | \n", "2018-06-01 | \n", "2.0 | \n", "67.08 | \n", "
wright3590 | \n", "Jacqueline | \n", "Wright | \n", "jacqueline.wright@gonzalez.com | \n", "True | \n", "2018-02-08 | \n", "6.0 | \n", "18.48 | \n", "
young | \n", "Jessica | \n", "Young | \n", "jessica4028@yahoo.com | \n", "True | \n", "2018-07-17 | \n", "4.0 | \n", "75.39 | \n", "
zachary.neal | \n", "Zachary | \n", "Neal | \n", "zneal@gmail.com | \n", "True | \n", "2018-07-26 | \n", "1.0 | \n", "39.90 | \n", "
475 rows × 7 columns
\n", "