AnalystPath

Hackathon Favorite With the Most Weighted Picks

PandasMediumMid level~10 min

Problem

You are given one DataFrame, `nominations`, loaded from `nominations.csv` with columns `judge` and `project`. Each row records that a judge nominated a project as a favorite. A judge gets one total vote: if a judge nominates several projects, that vote is split equally among them (nominating 2 projects gives each 0.5). An empty `project` means the judge abstained and contributes nothing.

Find the project(s) with the highest total weighted score. Return `project`, ordered by `project`.

Input data

Example rows — the live problem includes the full dataset.

nominations
judgeproject
DanaAurora
DanaBeacon
EliAurora
FarahBeacon
GilBeacon

Expected output

Your answer should return 1 row with the columns project.

Starter code (Pandas (Python))

import pandas as pd

def hackathon_favorite(nominations) -> pd.DataFrame:
    # Your code here
    return nominations

Solve 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

Related Pandas questions