Back to Modin

Demonstrating Bokeh Modin Interoperability

examples/jupyter/integrations/bokeh.ipynb

0.37.1970 B
Original Source

Demonstrating Bokeh Modin Interoperability

Currently Boken is not interoperable with Modin. Each visualization is created with a Modin and then pandas dataframe for comparison.

python
import modin.pandas as pd
import pandas
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource
from bokeh.io import show
python
# Create a visualization with Modin df 
modin_data = pd.DataFrame.from_dict({'x_values': [1, 2, 3, 4, 5], 'y_values': [6, 7, 2, 3, 6]})

# create a ColumnDataSource by passing the dict
source = ColumnDataSource(modin_data)

p = figure()
p.circle(x='x_values', y='y_values', source=source)
show(p)
python
# Create a visualization with pandas df 
pandas_data = pandas.DataFrame.from_dict({'x_values': [1, 2, 3, 4, 5], 'y_values': [6, 7, 2, 3, 6]})

# create a ColumnDataSource by passing the dict
source = ColumnDataSource(pandas_data)

p = figure()
p.circle(x='x_values', y='y_values', source=source)
show(p)