Solution: Summing and Swapping
This lesson gives a detailed review of the solution to the challenge in the previous lesson.
We'll cover the following...
We'll cover the following...
Solution #
Explanation
A function Sum_Swap is declared with df passed to it as a parameter.
-
On line 3, the
np.minfunction is applied on theDataFrameto retrieve all the minimum values from each row. Theaxis=1indicates that operation should only be performed on the rows. ASeriesis returned containing the minimum values for each ...