Logan Logan - 1 month ago 21
Python Question

Save selected points in a pandas data frame

I have a Bokeh scatter plot. I want to enable the lasso tool and then save the selected points in a pandas data frame for further processing with python in a Jupyter notebook.

Currently, accessing the

selected
property of
ColumnDataSource
returns an empty structure:

{'0d': {'flag': False, 'indices': []},
'1d': {'indices': []},
'2d': {'indices': []}}


This request is similar to this unanswered ticket.

Answer

I was able to find a solution through the use of Python Flask package and by communicating the selected points through the use of AJAX in customJS API that supports javascript.

Comments