基于python的图表生成系统代码_如何从python图表生成基于web的报表

我编写了以下代码来使用plotly库生成几个图表:#Read the excel file from local spreadsheet

df = pd.read_excel(r'C:\Users\llopez\Documents\Temp\Python finished goods.xlsx', sheet_name='Sheet1')

#Create a dictionary of tuples by year

dict_of_fgs = dict(tuple(df.groupby('Year')))

#Loop through the elements of the dictionary of finished goods and plots them grouping FG, type and calculating the sum of quantities. Stacking by type

for k in dict_of_fgs:

df_grouped = dict_of_fgs[k].groupby(['Finished_Good','Type'],sort=False)['Qty'].sum().unstack('Type').iplot(kind='bar',barmode='stack', title='FG Chart')

得出以下图表:

这些图表正是我需要的,所以现在我正在寻找一种方法来生成一个基于web的报告并与用户共享。在

我查看了下面的教程,但是我似乎不能使我的代码适应这一点,因为我的代码在字典中循环并为每个键(年)生成一个图。在

根据我创建的图表,如何生成基于web的报告?在

提前感谢你们所有的主题专家,为实现这一目标提供了所有的好主意。我很感激你的帮助。在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值