FastPrepNull Counts by Column
Problem · Database

Null Counts by Column

EasyWorld Wide Technology logoWorld Wide TechnologyINTERNPHONE SCREEN

Problem statement

You are given a Pandas dataframe named records with columns record_id, name, email, and score.

Return a dataframe containing the number of null values in each input column. The result must have columns column_name and null_count, include every input column even when its count is zero, and follow the input schema order shown above.

Table schema

Pandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

records

ColumnTypeNullableDescription
record_idIntegerYes
nameTextYes
emailTextYes
scoreDecimalYes

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
column_nameTextNo
null_countIntegerNo

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • records contains at most 10^5 rows.
  • All four input columns are nullable.
  • A null is any value recognized as missing by Pandas isna().

More World Wide Technology problems