I am new coding in python and bokeh. I have a .csv file with a column who has two kinds of factors (A and B). I can plot a chart with the values of A or B, but I would like to put a dropdown menu where I can select the factor (A or B) and update de plot.
Until now I have:
import numpy as np
import pandas as pd
from bokeh.plotting import figure
from bokeh.charts import output_file, show
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, Select
from bokeh.models.widgets import Div
df = pd.read_csv('/Users/Guilherme/Documents/Graficos/meusdados_3.csv', sep=';')
months = ['2017', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dez']
months2 = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dez']
p1 = figure (x_range=meses, plot_height = 400, plot_width = 1100, title = "Plot")
p1.vbar(x=months, top=df[df.type=='b']['month'], width=0.9) #bar chart
p1.square(x=months2, y=df[df.type=='b']['summ'], line_width=2, color='orange') #square points
p1.line(x=months2, y=df[df.type=='b']['summ'], line_width=2, color='orange') #line between points
p1.line(x=months2, y=df[df.type=='b']['limit'],line_width=2, color='red', line_dash = "dotted") #limit line
#Title
title = Div(text='<h1 style="text-align: center">Dashboard</h1>', width=1100, height=100)
show(column(title, p1))