☰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

Source.patch

Community Support
Rick
Rick

Anyone run across example that uses .patch to replace a column in column data source? To patch a whole column can I pass the col key or does it have to have an index as well?

⌁   Link to post
Bryan
Bryan

Hi,

The .patch method is really meant to only replace a few elements efficiently, so that's NOT necessary to update a whole column. If you need to replace a whole column, you can just replace it in the .data dict:

  source.data['foo'] = new_foo_column

But I would caution: It's a fundamental assumption of ColumnDataSource that all columns always have the same length. The new column must have the same length as any other existing columns on the source. This will warn in the near future, and eventually raise an error.

Thanks,

Bryan

···

On Dec 29, 2016, at 1:56 PM, Rick <ricksandusky@gmail.com> wrote:

Anyone run across example that uses .patch to replace a column in column data source? To patch a whole column can I pass the col key or does it have to have an index as well?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/33C2F930-1016-45CE-96E8-A42867B204B9%40gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post

End of archived discussion · Replies are disabled