I created an interactive Bokeh dashboard with several sliders. The configuration of all the sliders represent one scenario, which can be exported to a CSV file. Now I would like to be able to reload the scenario, which is stored in a CSV to update the values of the sliders. Unfortunately I am getting the following error:
ValueError: failed to validate Slider(id='3566', ...).value: expected a value of type Real, got [16.] of type ndarray
I dont understand what is meant with “type Real” and how to adjust it.
The FileInput lines look as follows:
def import_data(attr, old, new): decoded = b64decode(new) f = io.BytesIO(decoded) df=pd.read_csv(f, sep=';', engine='python') dff = pd.DataFrame(df) source=ColumnDataSource(data=dff) slider.value=source.data['Column1'] #the column has only 1 row with the value 16 slider2.value=source.data['Column2'] slider3.value=source.data['Column3'] file_input.on_change('value', import_data)
I have basically tried the same thing without ColumnDataSoure, but it resulted in the same error.