KnowledgeBoat Logo
|

Informatics Practices

Name and explain some cumulative functions provided by Pandas.

Python Pandas

2 Likes

Answer

The cumulative functions provided by Pandas are cumsum(), cumprod(), cummax(), cummin().

  1. cumsum() — It calculates cumulative sum i.e., in the output of this function, the value of each row is replaced by sum of all prior rows including this row. The syntax is <DF>.cumsum([axis = None]).

  2. cumprod() — It calculates cumulative product of values in a DataFrame object.

  3. cummax() — It calculates cumulative maximum of value from a DataFrame object.

  4. cummin() — It calculates cumulative minimum of value from a DataFrame object.

Answered By

1 Like


Related Questions