Skip to content

Instantly share code, notes, and snippets.

@AntonioMarsella
Created March 18, 2020 12:52
Show Gist options
  • Save AntonioMarsella/d9523d3bf24583def3ac686ea6619c33 to your computer and use it in GitHub Desktop.
Save AntonioMarsella/d9523d3bf24583def3ac686ea6619c33 to your computer and use it in GitHub Desktop.
Column Data Source basic in bokeh
from bokeh.models import ColumnDataSource
source = ColumnDataSource(data={'x': [1,2,3,4,5], 'y': [8,6,5,2,3]})
#pass a python dict to the initializer, that should have string keys and two arrays of
#the SAME length
print(source.data)
from bokeh.sampledata.iris import flowers as df
column_from_dataframe = ColumnDataSource(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment