I have a pandas dataframe in Python that looks something like
AccountID_x AccountId AmountCD_x AmountDOC_x AmountDoc_x 1 NaN 4001001
Try this:
df['new_column'] = df.apply(lambda x: x['AccountId'] if pd.isnull(x['AccountID_x']) else x['AccountID_x'], axis=1)