Created
October 14, 2021 01:14
-
-
Save ycui1/d33792bbf0b01b0df887086ba833be2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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