AnalystPath

Top Solar Installer per Panel Technology

PandasMediumMid level~10 min

Problem

A solar company tracks installers, the arrays they own, and the jobs run on those arrays, across three DataFrames loaded from CSV: `installers` (`installer_id`, `full_name`, `years_active`, `safety_flags`), `arrays` (`array_id`, `installer_id`, `panel_tech`, `watt_rating`), and `jobs` (`job_id`, `array_id`, `kilowatts`, `minutes`, `score`). Each array uses one panel_tech; each job records the kilowatts delivered and a customer satisfaction score from 1 to 5.

For every panel_tech find the single best installer ranked by, in order: highest average satisfaction score (rounded to 2 decimals), then highest total kilowatts, then fewest safety_flags on the installer record. Return a DataFrame with columns `panel_tech`, `installer_id`, `score`, `kilowatts`, ordered by `panel_tech`.

Input data

Example rows — the live problem includes the full dataset.

installers
installer_idfull_nameyears_activesafety_flags
1Nadia101
2Omar203
3Priya50
arrays
array_idinstaller_idpanel_techwatt_rating
1001Mono20000
1012Thin Film30000
1023Mono15000
jobs
job_idarray_idkilowattsminutesscore
20110050305
20210030204
203101100604
20410180505
20510240305

Expected output

Your answer should return 2 rows with the columns panel_tech, installer_id, score, kilowatts.

Starter code (Pandas (Python))

import pandas as pd

def top_installer(installers, arrays, jobs) -> pd.DataFrame:
    # Your code here
    return installers

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