Models must be owned by only a single document, ColumnDataSource(id='1196', ...) is already in a doc

Hello. I am trying to output table in jupyter notebook.Following is my code

df = pd.DataFrame(lst, columns=['date_','type','name','amount','id','yearmonth'])
source = ColumnDataSource(df)
columns = [
        TableColumn(field="date_", title="Date", formatter=DateFormatter()),
        TableColumn(field="type", title="Type"),
        TableColumn(field="name", title="Name"),
        TableColumn(field="amount", title="Amount")
]
data_table = DataTable(source=source, columns=columns, width=400, height=280)
show(data_table)

show(data_table) return next error:

RuntimeError: Models must be owned by only a single document, ColumnDataSource(id='1196', ...) is already in a doc

How to solve it?

Whatever is causing this is elsewhere in the notebook, we would need to example a compete notebook to investigate.

I just encountered a similiar problem (RuntimeError: Models must be owned by only a single document, …).
My problem was, that I tried to call the same show() command on two occasions with the same data.
Maybe that helps :slight_smile: