luvv to helpDiscover the Best Free Online Tools
Topic 6 of 10

Missing Data Handling

Learn Missing Data Handling for free with explanations, exercises, and a quick test (for Data Scientist).

Published: January 1, 2026 | Updated: January 1, 2026

Why this matters

Quick Test

This test is available to everyone; only logged-in users get saved progress.

Answer the questions to check your understanding. Then review mistakes and retry if needed.

Practice Exercises

3 exercises to complete

Instructions

Create the DataFrame below, then perform the steps.

import numpy as np
import pandas as pd

df = pd.DataFrame({
  'product': ['A', 'B', 'C', 'D', 'E'],
  'price': [10.0, np.nan, np.inf, 12.0, '11'],
  'category': ['toy', None, 'toy', '', 'unknown']
})
  1. Convert '', 'unknown', and infinities to NaN.
  2. Coerce price to numeric (invalid to NaN).
  3. Impute price with median, category with mode.
  4. Round price and set dtype to Int64.
  5. Show missing counts before and after.
Expected Output
A cleaned DataFrame with no missing in price/category; price as Int64 with rounded values; category filled with the most frequent category; before/after missing counts shown.

Missing Data Handling — Quick Test

Test your knowledge with 6 questions. Pass with 70% or higher.

6 questions70% to pass

Have questions about Missing Data Handling?

AI Assistant

Ask questions about this tool