Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
>>> def taking_larger_square(s1, s2):
... return s1 * s1 if s1.sum() > s2.sum() else s2 * s2
>>> df0.combine(df1.rename(columns={"c": "a", "d": "b"}), taking_larger_square)
a b
0 4 25
1 9 36
2 16 49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment