Q. What is the difference between sum and cumulative sum? How do you perform the two on DataFrame?


Answer =

Cumulative sum:- The cumulative sum is not the cumulative sum of the values. Instead it is the cumulative sum of differences between the values and the average. The amounts added to the cumulative sum will be positive and the sum will steadily increase.

SUM:- Sum is the simply sum of all values.

We use cumsum() to find cumulative sum and sum() to get sum of values of dataframe.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post