Skip to content

Instantly share code, notes, and snippets.

@AnasAlmasri
Created May 9, 2020 18:01
Show Gist options
  • Save AnasAlmasri/f42610a999f029dc8c06d89e7320411b to your computer and use it in GitHub Desktop.
Save AnasAlmasri/f42610a999f029dc8c06d89e7320411b to your computer and use it in GitHub Desktop.
# add cumulative sum columns to the dataframe
df['views_cumsum'] = df['views'].cumsum()
df['reads_cumsum'] = df['reads'].cumsum()
df['fans_cumsum'] = df['fans'].cumsum()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment