Sep-13-2022, 05:20 AM
(This post was last modified: Sep-13-2022, 05:27 AM by Yoriz.
Edit Reason: Added code tags
)
I have a dictionary as below:
I want the result as below:
https://imgur.com/5H9A2fv
So I think getting the table is quite complicated.
d={0:[{'key':'apple', 'count':50},{'key':'ibm', 'count':25}], 1: [{'key':'apple', 'count':40},{'key':'ibm', 'count':29}], 2:[{'key':'apple', 'count':44},{'key':'ibm', 'count':21}]}I want a bar plot but I have difficulty first reading it.
from bokeh.models import ColumnDataSource from bokeh.models.widgets import DataTable, DateFormatter, TableColumn from bokeh.layouts import widgetbox, column from bokeh.io import output_file, show source = ColumnDataSource(d) columns = [ TableColumn(field="key", title="Brand"), TableColumn(field="count", title="Count") ] data_table = DataTable(source=source, columns=columns, width=400, height=280) plot = column(widgetbox(data_table)) show(plot)
I want the result as below:
https://imgur.com/5H9A2fv
So I think getting the table is quite complicated.