def count_nulls(df, col_name):
col = df[col_name]
bool_col = pd.isna(col)
total_nulls = pd.Series.sum(bool_col)
total_rows = len(col)
pct_null = round((total_nulls / total_rows) * 100,2)
print("The","\'"+ str(col_name) + "\'", "field has", str(total_nulls), "nulls which account for",
str(pct_null) + "% of all values")
****图像****
enter image description here