We at CashBox would like you to update the user with email address kimberly@yahoo.com to have the last name "Deal".
There is a misspelling of a user whose username is jeffrey. It should only be one f
, jefrey.
There are a couple ways to make this change happen, let's see what you can figure out!
After you've completed the TODO's click the Run Tests
button
Need a little extra help? Check out the Treehouse Forum.
# Setup
import os
import pandas as pd
from tests.helpers import check
pd.options.display.max_rows = 10
users = pd.read_csv(os.path.join('data', 'users.csv'), index_col=0)
# Pop out a quick sanity check
len(users)
475
## CHALLENGE - Update users ##
# TODO: Update kimberly@yahoo.com to have the last name of "Deal"
# TODO: Update the username jeffrey to jefrey (only one f)
# Return the whole data frame
users
first_name | last_name | email_verified | signup_date | referral_count | balance | ||
---|---|---|---|---|---|---|---|
aaron | Aaron | Davis | aaron6348@gmail.com | True | 2018-08-31 | 6 | 18.14 |
acook | Anthony | Cook | cook@gmail.com | True | 2018-05-12 | 2 | 55.45 |
adam.saunders | Adam | Saunders | adam@gmail.com | False | 2018-05-29 | 3 | 72.12 |
adrian | Adrian | Fang | adrian.fang@teamtreehouse.com | True | 2018-04-28 | 3 | 30.01 |
adrian.blair | Adrian | Blair | adrian9335@gmail.com | True | 2018-06-16 | 7 | 25.85 |
... | ... | ... | ... | ... | ... | ... | ... |
wilson | Robert | Wilson | robert@yahoo.com | False | 2018-05-16 | 5 | 59.75 |
wking | Wanda | King | wanda.king@holt.com | True | 2018-06-01 | 2 | 67.08 |
wright3590 | Jacqueline | Wright | jacqueline.wright@gonzalez.com | True | 2018-02-08 | 6 | 18.48 |
young | Jessica | Young | jessica4028@yahoo.com | True | 2018-07-17 | 4 | 75.39 |
zachary.neal | Zachary | Neal | zneal@gmail.com | True | 2018-07-26 | 1 | 39.90 |
475 rows × 7 columns
check(__name__, 'Update users')
Button(description='Run Tests', style=ButtonStyle())
FF
======================================================================
FAIL: test_jeffrey_with_one_f (tests.helpers.TestUpdateUsers)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/craig/Code/scripting/intro-to-pandas/tests/test_cells.py", line 56, in test_jeffrey_with_one_f
'Did you rename the username jeffrey to jefrey?'
AssertionError: False is not true : Did you rename the username jeffrey to jefrey?
======================================================================
FAIL: test_kim_deal (tests.helpers.TestUpdateUsers)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/craig/Code/scripting/intro-to-pandas/tests/test_cells.py", line 50, in test_kim_deal
'Are you sure you updated the last name of kimberly@yahoo.com to "Deal"?'
AssertionError: nan != 'Deal' : Are you sure you updated the last name of kimberly@yahoo.com to "Deal"?
----------------------------------------------------------------------
Ran 2 tests in 0.003s
FAILED (failures=2)