C1_W1_Lab_4_patient_overlap_and_data_leakage

Test Case 1

df1
patient_id
0 0
1 1
2 2
df2
patient_id
0 2
1 3
2 4
leakage output: None

Test Case 2

df1
patient_id
0 0
1 1
2 2
df2
patient_id
0 3
1 4
2 5
leakage output: None

Error: Data-type mismatch, make sure you are using pandas functions
Error: Datatype mismatch, make sure you are using pandas functions
Error: Wrong output, make sure you are using pandas functions
Error: Wrong output, make sure you are using pandas functions
2 Tests passed
4 Tests failed

AssertionError Traceback (most recent call last)
in ()
1 ### do not edit this code cell
----> 2 check_for_leakage_test(check_for_leakage)

~/work/W1A1/public_tests.py in check_for_leakage_test(target)
69 ]
70
—> 71 multiple_test(test_cases, target)
72
73 ### ex2

~/work/W1A1/test_utils.py in multiple_test(test_cases, target)
120 print(‘\033[92m’, success," Tests passed")
121 print(‘\033[91m’, len(test_cases) - success, " Tests failed")
→ 122 raise AssertionError(“Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.”.format(target.name))
123
124 def multiple_test_weight_loss(test_cases, target, sess):

AssertionError: Not all tests were passed for check_for_leakage. Check your equations and avoid using global variables inside the function.

Hi @Dr_Keyur_Patel,

Are you using the pandas function ?

I have the same problem… How should I know that a function comes from pandas? :sweat_smile:
Thank you in advance!!

Hi @Jessica_Demarchi,

At the start of the assignment where all of the imports are happening you will see something like, import pandas as pd. What this means is that now throughout the assignment wherever pd is being used, it is using the pandas library. For example (just for explanation, it might not be a valid pandas function), if you use pd.sum then it means it is using the sum function from the pandas library.

Hope I made sense.

Cheers,
Mubsi

1 Like