How many gaps in each column

Data framesMedium9 min

Your task

Given readings with columns device, ts and reading, count the missing values in every column. Return column and nulls, one row per column, sorted by column ascending.

Examples

null_counts(readings: dataframe) -> dataframe
Example 1
Inputnull_counts(readings)
readings
devicetsreading
a12024-05-0120.5
a12024-05-02NULL
a12024-05-0322.5
b22024-05-01NULL
b22024-05-0231
b22024-05-0333
Output
columnnulls
device0
reading2
ts0