Grant Applicants Who Cleared Review
Problem
You are given two DataFrames. `applicants` has columns `applicant_id`, `panel_id`, and `tenure_years`; `applicant_id` uniquely identifies each applicant, `panel_id` is the review panel assigned to them, and `tenure_years` is how many years they have worked in the field. `reviews` has columns `panel_id` and `points`; a panel scores several criteria, so a `panel_id` may appear in multiple rows, each giving the points for one criterion.
Return the `applicant_id` of every applicant who has at least `3` years of tenure and whose combined review points across their panel sum to more than `20`. Return the result in any order, in one column `applicant_id`.
Input data
Example rows — the live problem includes the full dataset.
| applicant_id | panel_id | tenure_years |
|---|---|---|
| 1 | 100 | 5 |
| 2 | 200 | 2 |
| 3 | 300 | 4 |
| panel_id | points |
|---|---|
| 100 | 12 |
| 100 | 15 |
| 200 | 30 |
| 300 | 10 |
Expected output
Your answer should return 1 row with the columns applicant_id.
Starter code (Pandas (Python))
import pandas as pd
def grant_applicants_who_cleared_review(applicants, reviews) -> pd.DataFrame:
# Your code here
return applicantsSolve this Pandas question free
Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock