I have a data frame read in from a .csv with the following format:
version, 2x8x8, 2x8x10, 2x8x12, ...
v1.0.0, 10.2, 9.2, 8.2,
v1.0.1, 11.3, 10.4, 10.2,
v1.0.2, 9.5, 9.3, 9.1,
...
I want to plot this data frame as a multiline plot in bokeh where each column is its own line. The x axis being version num, and the y values being the content of the column excluding the header.
I have tried referencing the bokeh docs themselves but I cannot find the best way to extract the columns as "lists of lists" as bokeh expects.
# produces empty plot
f = figure(title='Example title')
versions = list(df['version'])
values = [list(df['2x8x8']), list(df['2x8x10']), ...]
f.multi_line(xs=versions, ys=values)
When I attempt to use the alternate ColumnDataSource approach, also specified in the bokeh docs, the plot takes all my y values and makes a new line for each.
# produces plot seen below
df = pd.read_csv(my.csv)
data_source = ColumnDataSource(df)
f = figure(title="Example")
f.line(x='version', y='2x8x8', source=data_source, line_width=2, legend='2x8x8')
f.line(x='version', y='2x8x10', source=data_source, line_width=2, legend='2x8x10')
f.xaxis.axis_label = 'version'
Any help is greatly appreciated!


