Skip to content
C

Problem 3: Fill Missing Numeric Values with Median

Easypython

Problem Description

Write a Python program that fills missing values in a numeric column with the column's median value.

Input

A DataFrame with a numeric column containing missing values.

Output

The column after filling missing values with the median.

Constraints

  • The column will contain at least one non-missing value.

Example Input

text
{"score": [50, None, 70, 90, None]}

Example Output

text
[50, 70, 70, 90, 70]

Concepts Covered

fillna(), median().

Input (stdin)

Output

Run your code to see output here...