Skip to content

Instantly share code, notes, and snippets.

@itsderek23
Created June 5, 2019 20:40
Show Gist options
  • Save itsderek23/19ec8e267f68fa9cb09a63b6b421f113 to your computer and use it in GitHub Desktop.
Save itsderek23/19ec8e267f68fa9cb09a63b6b421f113 to your computer and use it in GitHub Desktop.
Plot of Hubspot Total Contacts over Time w/Pandas
import matplotlib
import matplotlib.pyplot as plt
grouped = contacts.df.groupby(pd.Grouper(key="created",freq="M")).agg({"created": "count"})
grouped.rename(columns={"created": "new_contacts"},inplace=True)
grouped.cumsum().plot(title="Total Hubspot Contacts")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment