Created
May 3, 2019 13:10
-
-
Save karamanbk/5237238ffc483308c076642c26c41c4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a new dataframe for average revenue by taking the mean of it | |
tx_monthly_order_avg = tx_uk.groupby('InvoiceYearMonth')['Revenue'].mean().reset_index() | |
#print the dataframe | |
tx_monthly_order_avg | |
#plot the bar chart | |
plot_data = [ | |
go.Bar( | |
x=tx_monthly_order_avg['InvoiceYearMonth'], | |
y=tx_monthly_order_avg['Revenue'], | |
) | |
] | |
plot_layout = go.Layout( | |
xaxis={"type": "category"}, | |
title='Monthly Order Average' | |
) | |
fig = go.Figure(data=plot_data, layout=plot_layout) | |
pyoff.iplot(fig) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment