☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How to get the new dataframe after use datatable edit

Community Support
danwang123
danwang123

I am using Bokeh 2.0.1, I want to edit the data table and use the new data from edited datatable. Is anyone can suggest how to get the new data after edit datatable ( I am pretty new to Bokeh)? Thanks!

from bokeh.models import ColumnDataSource
from bokeh.models.widgets import DataTable, TableColumn, StringEditor, IntEditor
import pandas as pd
from bokeh.io import output_notebook, show
output_notebook()

df = pd.DataFrame([[0, 1,2],[1,4,5], [0,5,6]])
df.columns = [‘x’, ‘one’, ‘two’]
cds = ColumnDataSource(df)

columns = [
TableColumn(field=“one”, title=“ONE”, editor=IntEditor()),
TableColumn(field=“two”, title=“TWO”)
]

dt = DataTable(source=cds, columns=columns,
sortable=True, editable=True, fit_columns=True, selectable=True)

show(dt)
df=dt.source.data

⌁   Link to post
Bryan
Bryan

Hi @danwang123 first please edit your post to use code formatting so that the code is intelligible (either with the </> icon on the editing toolbar, or triple backtick ``` fences around the code blocks)

Second, does “get the new data value” mean:

  • get the value in JavaScript? or
  • get the value in Python?

If the latter, then that requires creating and running a Bokeh Server Application which is structured differently from what you have above

⌁   Link to post
danwang123
danwang123

Hi , Thanks a lot! I Will pay attention to post code.
I mean get the value from the changed datatable source after editing the datatable in Jupyter notebook. A function which is very similar to qgrid.get_changed_df(). Thanks!

⌁   Link to post

End of archived discussion · Replies are disabled