replace value column by another if missing pandas code example
Example: replace value column by another if missing pandas
import numpy as np
df['column'] = np.where(df['column'].isnull(), 'value_if_true', 'value_if_false')
import numpy as np
df['column'] = np.where(df['column'].isnull(), 'value_if_true', 'value_if_false')