I have a pandas dataframe in Python that looks something like
AccountID_x AccountId AmountCD_x AmountDOC_x AmountDoc_x 1 NaN 4001001
You can also propagate fillna using apply:
fillna
apply
df2['newcolumn'] = df2[['AccountID_x','AccountId']].apply(lambda x: x.fillna(method='ffill')[-1], axis=1)
Or equivalently (in your case):
df2['newcolumn'] = df2[['AccountID_x','AccountId']].apply(lambda x: x.fillna(method='bfill')[0], axis=1)