{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Optional Challenge 1 - Top Referrers\n", "\n", "We at CashBox believe that referrers are a great asset to our product. We'd like to know the top referrers with verified email addresses, so that we can send them some motivational emails. \n", "\n", "Currently, anyone with **5 or more** referrals is considered a top referrer.\n", "\n", "When you have completed the challenge, press the `Run Tests` button.\n", "\n", "*Need a little extra help? Check out the [Treehouse Forum](https://teamtreehouse.com/community?instruction=4552).*" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "475" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Setup\n", "import os\n", "import pandas as pd\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", "# Pop out a quick sanity check\n", "len(users)" ] }, { "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 | \n", "18.14 | \n", "
acook | \n", "Anthony | \n", "Cook | \n", "cook@gmail.com | \n", "True | \n", "2018-05-12 | \n", "2 | \n", "55.45 | \n", "
adam.saunders | \n", "Adam | \n", "Saunders | \n", "adam@gmail.com | \n", "False | \n", "2018-05-29 | \n", "3 | \n", "72.12 | \n", "
adrian | \n", "Adrian | \n", "Fang | \n", "adrian.fang@teamtreehouse.com | \n", "True | \n", "2018-04-28 | \n", "3 | \n", "30.01 | \n", "
adrian.blair | \n", "Adrian | \n", "Blair | \n", "adrian9335@gmail.com | \n", "True | \n", "2018-06-16 | \n", "7 | \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 | \n", "59.75 | \n", "
wking | \n", "Wanda | \n", "King | \n", "wanda.king@holt.com | \n", "True | \n", "2018-06-01 | \n", "2 | \n", "67.08 | \n", "
wright3590 | \n", "Jacqueline | \n", "Wright | \n", "jacqueline.wright@gonzalez.com | \n", "True | \n", "2018-02-08 | \n", "6 | \n", "18.48 | \n", "
young | \n", "Jessica | \n", "Young | \n", "jessica4028@yahoo.com | \n", "True | \n", "2018-07-17 | \n", "4 | \n", "75.39 | \n", "
zachary.neal | \n", "Zachary | \n", "Neal | \n", "zneal@gmail.com | \n", "True | \n", "2018-07-26 | \n", "1 | \n", "39.90 | \n", "
475 rows × 7 columns
\n", "