Profiling a DataFrame

easy
Unit 5 · Pandas & Outliers0/3 to milestone

Implement profile(df) returning a DataFrame with one row per column of df (in the original order, indexed by column name) and these columns:

  • dtype: the pandas dtype as a string
  • missing_pct: percentage of missing values, rounded to 1 decimal
  • n_unique: number of distinct non-missing values
  • top: the most frequent non-missing value (ties to the value that sorts first as a string), or None if the column is empty
#pandas#data-quality#eda2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Profiling a DataFrame · TechGradify