cumulative sum in python

Solutions on MaxInterview for cumulative sum in python by the best coders in the world

showing results for - "cumulative sum in python"
Sophie
16 Sep 2016
1import pandas as pd
2import numpy as np
3  
4# Create a dataframe
5df1 = pd.DataFrame({"A":[None, 3, 8, 14], 
6                   "B":[1, None, 4, 3], 
7                   "C":[5, 3, 9,None]}) 
8  
9# Computing sum over Index axis
10print(df1.cumsum(axis = 0, skipna = True))
11#skipna exclude null values