我使用 Bokeh 创建了网站。我的网站显示表格。我正在寻求有关根据“日期”标准过滤 df(Pandas 数据框) 的帮助。用户需要输入“开始”日期和“结束”日期。然后输出表应该显示在网站上。
看来我需要帮助来创建 customJS 或任何回调函数。有人可以帮我吗?
需要两个输入框来输入“从”日期和“到”日期并链接到表格。因此,每当日期更改时,表格应仅显示该特定范围数据框。有人可以在这里帮助我吗?
df.head()
Source = ColumnDataSource(df2.sort_index(ascending=False) )
Columns = [ TableColumn(field=f, title=f, formatter=date, width=75) for f in date_col]+\
[ TableColumn(field=f, title=f, formatter=formater,width=75) for f in ['Benchmark']]+\
[ TableColumn(field=f, title=f, formatter=formater, width=75) for f in ['Quality']]+\
[ TableColumn(field=f, title=f, formatter=formater, width=75) for f in ['Value']]+\
[ TableColumn(field=f, title=f, formatter=formater, width=75) for f in ['Momentum']]+\
[ TableColumn(field=f, title=f, formatter=formater, width=75) for f in ['Low_Volatility']]
table1 = DataTable(source = Source, columns = Columns, width = 600, height = 1000, css_classes = ['my_class'])
select = Select(title="Indices_List:", value="ACWI", options=["ACWI",
"World", "EM", "EAFE","US", "Canada","Poland"], width= 20)
tab = Panel(child=column(select, table1), title="Universal Table")
tabs = Tabs(tabs=[tab,])
output_notebook()
show(tabs)