For future visitors: My original question was closed as a duplicate, but the old 'multiline' function in the linked answer is depreciated years ago.
I would like to plot a selection of pandas columns using bokeh, i.e. multiple lines in one chart. Code showing one column/line works:
import pandas as pd
import numpy as np
from bokeh.plotting import figure, show
from bokeh.models import ColumnDataSource
df = pd.DataFrame(np.random.randint(0,100,size=(100, 5)), columns=list('ABCDF'))
sss = ColumnDataSource(df)
p = figure(height=300, width=300)
x = df.index
y = df[['B']]
p.line(x, y)
show(p)
Now, how do I plot columns A, C and F in the same line chart?
I tried this, but does not work:
x = df.index
y = df[['A', 'C', 'F']]
p.line(x, y)
show(p)