One Boxplot for each column of a DataFrame, but it fails

I’d like to have a boxplot for each column of my dataframe (example), with pandas it’s as easy as df.plot.box*()*, but with Bokeh I must specify the categorical variable, even if it is an optional parameter.

`from bokeh.charts import BoxPlot, show
import pandas as pd

df = pd.DataFrame({‘one’: [1,2,3,7,8,4,-1,5,2,1], ‘two’:[1,1,1,2,2,2,2,1,1,1]})

this works

p1 = BoxPlot(df, values=‘one’, label=‘two’)
show(p1)

this compiles a HTML file but rendering fails with the message below

p2 = BoxPlot(df, values=‘one’)
show(p2)`

this also fails

p3 = BoxPlot(df)
show(p3)

``

Here’s the error message: “null is not an object (evaluation ‘h.indexOf’)”

···

On Thursday, May 4, 2017 at 6:21:29 PM UTC+2, Enrico Rotundo wrote:

I’d like to have a boxplot for each column of my dataframe (example), with pandas it’s as easy as df.plot.box*()*, but with Bokeh I must specify the categorical variable, even if it is an optional parameter.

`from bokeh.charts import BoxPlot, show
import pandas as pd

df = pd.DataFrame({‘one’: [1,2,3,7,8,4,-1,5,2,1], ‘two’:[1,1,1,2,2,2,2,1,1,1]})

this works

p1 = BoxPlot(df, values=‘one’, label=‘two’)
show(p1)

this compiles a HTML file but rendering fails with the message below

p2 = BoxPlot(df, values=‘one’)
show(p2)`

this also fails

p3 = BoxPlot(df)
show(p3)

``

Hi,

Bokeh is not the same as pandas. They have different nyerfaces, and the labels parameter is not optional, it is required to specify what column to do a groupby of:

http://bokeh.pydata.org/en/latest/docs/user_guide/charts.html#box-plots

If you’d like BoxPlot to behave differently then you can file a feature request issue in the bkcharts repo, which will soon be the new home of bokeh.charts:

https://github.com/bokeh/bkcharts

Thanks,

Bryan

···

On May 5, 2017, at 00:56, Enrico Rotundo [email protected] wrote:

Here’s the error message: “null is not an object (evaluation ‘h.indexOf’)”

On Thursday, May 4, 2017 at 6:21:29 PM UTC+2, Enrico Rotundo wrote:

I’d like to have a boxplot for each column of my dataframe (example), with pandas it’s as easy as df.plot.box*()*, but with Bokeh I must specify the categorical variable, even if it is an optional parameter.

`from bokeh.charts import BoxPlot, show
import pandas as pd

df = pd.DataFrame({‘one’: [1,2,3,7,8,4,-1,5,2,1], ‘two’:[1,1,1,2,2,2,2,1,1,1]})

this works

p1 = BoxPlot(df, values=‘one’, label=‘two’)
show(p1)

this compiles a HTML file but rendering fails with the message below

p2 = BoxPlot(df, values=‘one’)
show(p2)`

this also fails

p3 = BoxPlot(df)
show(p3)

``

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/bffa3cd4-1841-48d4-b909-eb6402916bb1%40continuum.io.

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