Source.patch

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?

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 <[email protected]> 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 [email protected].
To post to this group, send email to [email protected].
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\.