Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
'trial_subscription_revenue_usd_vat':float,'renewal_subscription_revenue_usd_vat':float}
redshiftdata = redshiftdata.astype(convert_dict)
# filling missing values of numeric columns with zero
redshiftdata = redshiftdata.fillna(0)
import plotly.plotly as py
import plotly.graph_objs as go
data = [
go.Bar(
x=momrevenue['yearmonth'], # assign x as the dataframe column 'x'
y=momrevenue['revenue']
)
]
# IPython notebook
# py.iplot(data, filename='pandas-bar-chart')
writer = pd.ExcelWriter('report.xlsx',)
momrevenue.to_excel(writer, 'Sheet1',index=False )
portal.to_excel(writer, 'Sheet2',index=False )
writer.save()
#let’s generate an excel report using predefind template with 1 sheet containing the results of
the pivot tables
import openpyxl
momrevenue = redshiftdata.groupby(['YearMonth'])['revenue'].sum().to_frame().reset_index()
html_out = template.render(template_vars)