from pandas import *
import numpy as np
df = DataFrame({'A': [5, 6, 3], 'B': [0, 0, 0], 'C': [0, 0, 0], 'D': [3, 4, 5]}
    )
for idx, row in df.iterrows():
    if row['B'] == 0:
        row['B'] = min(row['A'], row['D'])
if row['C'] == 0:
    row['C'] = min(row['A'], row['D'])
Pandas DataFrame Применить