Using High-level Chart in Jupyter Notebook

I was using Bokeh lib just fine until one day I switched to Anaconda distribution.

Just a simple spin of the bar chart example gave me a hard time: original code here, highlighted part is what I added.

from bokeh.charts import Bar, output_file, show, output_notebook

prepare some data

data = {“y”: [6, 7, 2, 4, 5], “z”: [1, 5, 12, 4, 2]}

output to static HTML file

output_file(“bar.html”)

create a new line chat with a title and axis labels

p = Bar(data, cat=[‘C1’, ‘C2’, ‘C3’, ‘D1’, ‘D2’], title=“Bar example”,
xlabel=‘categories’, ylabel=‘values’, width=400, height=400)
output_notebook()

show the results

show(p)

Error message as such:

ERROR:C:\Users\paul.dong\Documents\Apps\Anaconda\lib\site-packages\bokeh\validation\check.pyc:W-1003 (MALFORMED_CATEGORY_LABEL): Category labels are malformed: [field:caty] [first_value: C1:0.333333333333] [renderer: GlyphRenderer, ViewModel:GlyphRenderer, ref _id: e732fc67-f26f-48a1-ac50-dcf2ab0b0fd7]
ERROR:C:\Users\paul.dong\Documents\Apps\Anaconda\lib\site-packages\bokeh\validation\check.pyc:W-1003 (MALFORMED_CATEGORY_LABEL): Category labels are malformed: [field:catz] [first_value: C1:0.666666666667] [renderer: GlyphRenderer, ViewModel:GlyphRenderer, ref _id: 9737b7cd-c909-47eb-8c05-a8160b0ba23b]

So the html file output still normal, but the notebook output just won't show.

Appreciate your help.

I think the problem may have arisen due to the new validation functions in 0.9.3, which is a welcoming new feature to bokeh. But the growing pain here is some categorical index are now being interpreted correctly.

I have downgraded back to bokeh 0.9.2 and it is fine.

···

On Friday, 11 September 2015 14:17:48 UTC+8, PaulYCDong wrote:

I was using Bokeh lib just fine until one day I switched to Anaconda distribution.

Just a simple spin of the bar chart example gave me a hard time: original code here, highlighted part is what I added.

from bokeh.charts import Bar, output_file, show, output_notebook

prepare some data

data = {“y”: [6, 7, 2, 4, 5], “z”: [1, 5, 12, 4, 2]}

output to static HTML file

output_file(“bar.html”)

create a new line chat with a title and axis labels

p = Bar(data, cat=[‘C1’, ‘C2’, ‘C3’, ‘D1’, ‘D2’], title=“Bar example”,
xlabel=‘categories’, ylabel=‘values’, width=400, height=400)
output_notebook()

show the results

show(p)

Error message as such:

ERROR:C:\Users\paul.dong\Documents\Apps\Anaconda\lib\site-packages\bokeh\validation\check.pyc:W-1003 (MALFORMED_CATEGORY_LABEL): Category labels are malformed: [field:caty] [first_value: C1:0.333333333333] [renderer: GlyphRenderer, ViewModel:GlyphRenderer, ref _id: e732fc67-f26f-48a1-ac50-dcf2ab0b0fd7]
ERROR:C:\Users\paul.dong\Documents\Apps\Anaconda\lib\site-packages\bokeh\validation\check.pyc:W-1003 (MALFORMED_CATEGORY_LABEL): Category labels are malformed: [field:catz] [first_value: C1:0.666666666667] [renderer: GlyphRenderer, ViewModel:GlyphRenderer, ref _id: 9737b7cd-c909-47eb-8c05-a8160b0ba23b]


So the html file output still normal, but the notebook output just won't show.


Appreciate your help.

Hi Paul,

Yes you are right. The problem is related to the new validation functions that raise warnings. We have an open issue for that here: https://github.com/bokeh/bokeh/issues/2818

Thanks

Fabio

···

On Mon, Sep 14, 2015 at 4:20 AM, PaulYCDong [email protected] wrote:

I think the problem may have arisen due to the new validation functions in 0.9.3, which is a welcoming new feature to bokeh. But the growing pain here is some categorical index are now being interpreted correctly.

I have downgraded back to bokeh 0.9.2 and it is fine.

On Friday, 11 September 2015 14:17:48 UTC+8, PaulYCDong wrote:

I was using Bokeh lib just fine until one day I switched to Anaconda distribution.

Just a simple spin of the bar chart example gave me a hard time: original code here, highlighted part is what I added.

from bokeh.charts import Bar, output_file, show, output_notebook

prepare some data

data = {“y”: [6, 7, 2, 4, 5], “z”: [1, 5, 12, 4, 2]}

output to static HTML file

output_file(“bar.html”)

create a new line chat with a title and axis labels

p = Bar(data, cat=[‘C1’, ‘C2’, ‘C3’, ‘D1’, ‘D2’], title=“Bar example”,
xlabel=‘categories’, ylabel=‘values’, width=400, height=400)
output_notebook()

show the results

show(p)

Error message as such:

ERROR:C:\Users\paul.dong\Documents\Apps\Anaconda\lib\site-packages\bokeh\validation\check.pyc:W-1003 (MALFORMED_CATEGORY_LABEL): Category labels are malformed: [field:caty] [first_value: C1:0.333333333333] [renderer: GlyphRenderer, ViewModel:GlyphRenderer, ref _id: e732fc67-f26f-48a1-ac50-dcf2ab0b0fd7]
ERROR:C:\Users\paul.dong\Documents\Apps\Anaconda\lib\site-packages\bokeh\validation\check.pyc:W-1003 (MALFORMED_CATEGORY_LABEL): Category labels are malformed: [field:catz] [first_value: C1:0.666666666667] [renderer: GlyphRenderer, ViewModel:GlyphRenderer, ref _id: 9737b7cd-c909-47eb-8c05-a8160b0ba23b]


So the html file output still normal, but the notebook output just won't show.


Appreciate your help.

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/cdb23ca8-0a2f-49a1-b690-155fa9089150%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Fabio Pliger

Senior Software Engineer, Bokeh