I have a 20 x 4000 dataframe in Python using pandas. Two of these columns are named Year and quarter. I\'d like to create a variable called p
Year
quarter
p
Use .combine_first.
.combine_first
df['Period'] = df['Year'].combine_first(df['Quarter'])