Premium problem141. Missing-Value Report

Easy Locked

Given any DataFrame df, return a report with one row per column and columns column, missing_count and missing_pct, the percentage of that column's rows that are missing, rounded to 2 decimal places.

Sort by missing_pct descending then column alphabetically, and renumber the index from 0. Include columns with nothing missing.

Input

     a  b    c
0  1.0  1  NaN
1  NaN  2  NaN
2  3.0  3  NaN
3  NaN  4  1.0

Output

  column  missing_count  missing_pct
0      c              3         75.0
1      a              2         50.0
2      b              0          0.0

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)