Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 17, 2020 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/1491ed83894d651e6a70954e95b722e3 to your computer and use it in GitHub Desktop.
Save velotiotech/1491ed83894d651e6a70954e95b722e3 to your computer and use it in GitHub Desktop.
group_by_year = df.loc[:, ['year', 'revenue', 'profit']].groupby('year')
avgs = group_by_year.mean()
x = avgs.index
y = avgs.profit
fig, ax = plt.subplots()
plot(x, y, ax, 'Increase in mean Fortune 500 company profits from 1955 to 2013', 'Profit (millions)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment