Run ❯
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import pandas as pd df1 = pd.DataFrame([[1, 2], [3, 4]]) df2 = pd.DataFrame([[5, 6], [7, 8]]) def myfunc(a, b) : if (a.sum() > b.sum()): return a else: return b print(df1.combine(df2, myfunc))
0 1 0 5 6 1 7 8