每个列和行中都有链接的表(到html)

2024-09-29 01:34:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我想为从Flask返回到html函数的表的每一列/每一行创建链接

例如:

In each column/row I need a link with the month and branch to return the details

我的代码:

 dfResult = pd.pivot_table(df1, 
                        #columns=['Branch'],
                        values=['Vessels Count'],
                        columns=['Branch'],
                        index=['Month'], 
                        aggfunc=np.sum,
                        margins=True,
                        margins_name='Total',                        
                        fill_value=0).astype(np.float64).round(2).T

    return(dfResult.to_html(classes='mystyle'))

提前谢谢


Tags: columnstheto函数inbranchflaskreturn