count if null column pandas code example
Example 1: python count null values in dataframe
# Count total missing values in a dataframe
df.isnull().sum().sum()
# Gives a integer value
Example 2: python if column is null then
df['real_lastName'] = np.where(df['LastName'].isnull(), df['Middle'], df['LastName'] )
print (df)
FirstName Middle LastName real_lastName
0 Tom Ju NaN Ju
1 Kity NaN Rob Rob