Assuming I have a dataframe looking like below:
import pandas as pd
import numpy as np
d = {'Column 1': [10, 12,13,43,np.nan],
'Column2':[np.nan,7,np.nan,49,8]}
df = pd.DataFrame(d)
I would like to create a third column with a condition to take values from Column 2 unless they are NaNs. So looking like below:
I have found multiple topics/solutions where the condition was dependent on values in one column but could not find one where it had to provide data from more than one column.