Q:

Python: how to merge 2 columns without overwriting?

I'm trying to merge 2 columns in python: 
both column A and column B contains names of states. I'd love to merge column An and column B to get the "Ideal Result" column. How can i achieve it in python? Thanks a lot!
And this is in Python; they are dataframes. 

A:

If it is a dataframe, I think you could try to use np.where:
df['idealcol'] = np.where(df['A'].isnull(), df['B'] , df['A'])

