BoxPlot with list of integers

Hi guys,

The situation is really simple : I want a single boxplot from a list of integers, and I don’t understand the error message: TypeError: ‘NoneType’ object is not subscriptable.

data=ColumnDataSource( df)

bp = BoxPlot( data=data, values=‘values’)
show( bp)

with df.info() =>

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 726 entries, 0 to 725
Data columns (total 1 columns):
values 726 non-null int64
dtypes: int64(1)
memory usage: 5.8 KB

Any one got an idea ?
Thanks
alEx

Hi Alex,

Try this:
```
a = None
b = a[0]
```

You will get an error like you have. That's a very common error and

without a running example it’s impossible to help.

Have a nice evening.

Raphael
···

On 2017-05-16 19:13, alEx S wrote:

Hi guys,

      The situation is really simple : I want a single boxplot

from a list of integers, and I don’t understand the error
message: TypeError: ‘NoneType’ object is not subscriptable.

data=ColumnDataSource( df)

bp = BoxPlot( data=data, values=‘values’)
show( bp)

with df.info() =>

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 726 entries, 0 to 725
Data columns (total 1 columns):
values 726 non-null int64
dtypes: int64(1)
memory usage: 5.8 KB


Any one got an idea ?
Thanks
alEx

  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/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io?utm_medium=email&utm_source=footer).

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

Thanks Raphael,

I understand the error and made a new simple test which provide a javascrip error:

···

from bokeh.io import output_notebook, show

from bokeh.charts import BoxPlot

from bokeh.sampledata.iris import flowers

output_notebook()

works well

p = BoxPlot(flowers, label=‘species’, values=‘petal_width’, tools=‘crosshair’, color=’#aa4444’,

xlabel=’’, ylabel=‘petal width, mm’, title=‘Distributions of petal widths’)

show§

gives a javascript error

bp = BoxPlot( data=flowers, values=‘sepal_length’)

show( bp)


=> Javascript error adding output!

TypeError: Cannot read property ‘indexOf’ of null

See your browser Javascript console for more details.

And I really don’t know anything about javascript.

So what’s the heck ? Is there a way having only one BoxPlot when working with time series ? Or BoxPlot can’t figure out a singleton ?

Thanks

On Tue, May 16, 2017 at 10:07 PM Raphael Walker [email protected] wrote:

Hi Alex,

Try this:

```

a = None

b = a[0]

```



You will get an error like you have. That's a very common error and

without a running example it’s impossible to help.

Have a nice evening.



Raphael

On 2017-05-16 19:13, alEx S wrote:

Hi guys,

      The situation is really simple : I want a single boxplot

from a list of integers, and I don’t understand the error
message: TypeError: ‘NoneType’ object is not subscriptable.

data=ColumnDataSource( df)

bp = BoxPlot( data=data, values=‘values’)
show( bp)

with df.info() =>

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 726 entries, 0 to 725
Data columns (total 1 columns):
values 726 non-null int64
dtypes: int64(1)
memory usage: 5.8 KB


Any one got an idea ?
Thanks
alEx

  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/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io?utm_medium=email&utm_source=footer).

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

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/f5488c51-1ae0-7b3d-85a0-0f821001a869%40busino.ch.

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

I found this as an issue (#49 in bkcharts) : Closed ; And duplicate-open in bokeh #5868 !?

···

On Wed, May 17, 2017 at 9:27 AM Alex Schmitt [email protected] wrote:

Thanks Raphael,

I understand the error and made a new simple test which provide a javascrip error:


from bokeh.io import output_notebook, show

from bokeh.charts import BoxPlot

from bokeh.sampledata.iris import flowers

output_notebook()

works well

p = BoxPlot(flowers, label=‘species’, values=‘petal_width’, tools=‘crosshair’, color=’#aa4444’,

xlabel=’’, ylabel=‘petal width, mm’, title=‘Distributions of petal widths’)

show§

gives a javascript error

bp = BoxPlot( data=flowers, values=‘sepal_length’)

show( bp)


=> Javascript error adding output!

TypeError: Cannot read property ‘indexOf’ of null

See your browser Javascript console for more details.

And I really don’t know anything about javascript.

So what’s the heck ? Is there a way having only one BoxPlot when working with time series ? Or BoxPlot can’t figure out a singleton ?

Thanks

On Tue, May 16, 2017 at 10:07 PM Raphael Walker [email protected] wrote:

Hi Alex,

Try this:

```

a = None

b = a[0]

```



You will get an error like you have. That's a very common error and

without a running example it’s impossible to help.

Have a nice evening.



Raphael

On 2017-05-16 19:13, alEx S wrote:

Hi guys,

      The situation is really simple : I want a single boxplot

from a list of integers, and I don’t understand the error
message: TypeError: ‘NoneType’ object is not subscriptable.

data=ColumnDataSource( df)

bp = BoxPlot( data=data, values=‘values’)
show( bp)

with df.info() =>

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 726 entries, 0 to 725
Data columns (total 1 columns):
values 726 non-null int64
dtypes: int64(1)
memory usage: 5.8 KB


Any one got an idea ?
Thanks
alEx

  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/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io?utm_medium=email&utm_source=footer).

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

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/f5488c51-1ae0-7b3d-85a0-0f821001a869%40busino.ch.

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

You probably still need to assign some sort of label for the categorical axis. I’d first try an array of constant value. If that doesn’t work, try adding it as a new column to the flowers dataframe (or column data source?).
-Paul

···

On Wed, May 17, 2017 at 3:20 AM, Alex Schmitt [email protected] wrote:

I found this as an issue (#49 in bkcharts) : Closed ; And duplicate-open in bokeh #5868 !?

On Wed, May 17, 2017 at 9:27 AM Alex Schmitt [email protected] wrote:

Thanks Raphael,

I understand the error and made a new simple test which provide a javascrip error:


from bokeh.io import output_notebook, show

from bokeh.charts import BoxPlot

from bokeh.sampledata.iris import flowers

output_notebook()

works well

p = BoxPlot(flowers, label=‘species’, values=‘petal_width’, tools=‘crosshair’, color=’#aa4444’,

xlabel=’’, ylabel=‘petal width, mm’, title=‘Distributions of petal widths’)

show§

gives a javascript error

bp = BoxPlot( data=flowers, values=‘sepal_length’)

show( bp)


=> Javascript error adding output!

TypeError: Cannot read property ‘indexOf’ of null

See your browser Javascript console for more details.

And I really don’t know anything about javascript.

So what’s the heck ? Is there a way having only one BoxPlot when working with time series ? Or BoxPlot can’t figure out a singleton ?

Thanks

On Tue, May 16, 2017 at 10:07 PM Raphael Walker [email protected] wrote:

Hi Alex,

Try this:

```

a = None

b = a[0]

```



You will get an error like you have. That's a very common error and

without a running example it’s impossible to help.

Have a nice evening.



Raphael

On 2017-05-16 19:13, alEx S wrote:

Hi guys,

      The situation is really simple : I want a single boxplot

from a list of integers, and I don’t understand the error
message: TypeError: ‘NoneType’ object is not subscriptable.

data=ColumnDataSource( df)

bp = BoxPlot( data=data, values=‘values’)
show( bp)

with df.info() =>

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 726 entries, 0 to 725
Data columns (total 1 columns):
values 726 non-null int64
dtypes: int64(1)
memory usage: 5.8 KB


Any one got an idea ?
Thanks
alEx

  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/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io?utm_medium=email&utm_source=footer).

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

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/f5488c51-1ae0-7b3d-85a0-0f821001a869%40busino.ch.

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

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/CAJjPzf8qPezrtTKnDSGHMhxWKzCV7YC0d5an8k3zutm%2BgOrFvw%40mail.gmail.com.

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

Thanks Paul.
Actually in a previous email to this list I mentionned there was an issue opened on bkcharts on github.

BoxPlot doesn’t accept to pic only one box at this time. I found a work around and put it on https://github.com/bokeh/bkcharts/issues/49#issuecomment-302115522 . One needs to add a fake column with only one value in the DataFrame as in:


from bokeh.charts import BoxPlot, show, output_notebook
from bokeh.layouts import row
from bokeh.sampledata.autompg import autompg as df
df[ 'label'] = 1
box = BoxPlot( df, values='mpg', label='label', plot_width=400, color='your fav col')
output_notebook()
show(box)

alEx

···

On Wed, May 17, 2017 at 3:20 AM, Alex Schmitt [email protected] wrote:

I found this as an issue (#49 in bkcharts) : Closed ; And duplicate-open in bokeh #5868 !?

On Wed, May 17, 2017 at 9:27 AM Alex Schmitt [email protected] wrote:

Thanks Raphael,

I understand the error and made a new simple test which provide a javascrip error:


from bokeh.io import output_notebook, show

from bokeh.charts import BoxPlot

from bokeh.sampledata.iris import flowers

output_notebook()

works well

p = BoxPlot(flowers, label=‘species’, values=‘petal_width’, tools=‘crosshair’, color=’#aa4444’,

xlabel=’’, ylabel=‘petal width, mm’, title=‘Distributions of petal widths’)

show§

gives a javascript error

bp = BoxPlot( data=flowers, values=‘sepal_length’)

show( bp)


=> Javascript error adding output!

TypeError: Cannot read property ‘indexOf’ of null

See your browser Javascript console for more details.

And I really don’t know anything about javascript.

So what’s the heck ? Is there a way having only one BoxPlot when working with time series ? Or BoxPlot can’t figure out a singleton ?

Thanks

On Tue, May 16, 2017 at 10:07 PM Raphael Walker [email protected] wrote:

Hi Alex,

Try this:

```

a = None

b = a[0]

```



You will get an error like you have. That's a very common error and

without a running example it’s impossible to help.

Have a nice evening.



Raphael

On 2017-05-16 19:13, alEx S wrote:

Hi guys,

      The situation is really simple : I want a single boxplot

from a list of integers, and I don’t understand the error
message: TypeError: ‘NoneType’ object is not subscriptable.

data=ColumnDataSource( df)

bp = BoxPlot( data=data, values=‘values’)
show( bp)

with df.info() =>

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 726 entries, 0 to 725
Data columns (total 1 columns):
values 726 non-null int64
dtypes: int64(1)
memory usage: 5.8 KB


Any one got an idea ?
Thanks
alEx

  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/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io?utm_medium=email&utm_source=footer).

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

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/f5488c51-1ae0-7b3d-85a0-0f821001a869%40busino.ch.

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

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/CAJjPzf8qPezrtTKnDSGHMhxWKzCV7YC0d5an8k3zutm%2BgOrFvw%40mail.gmail.com.

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

Yes. That’s what I was suggesting. Glad it worked out.

···

On Wed, May 17, 2017 at 8:47 AM, Alex Schmitt [email protected] wrote:

Thanks Paul.
Actually in a previous email to this list I mentionned there was an issue opened on bkcharts on github.

BoxPlot doesn’t accept to pic only one box at this time. I found a work around and put it on https://github.com/bokeh/bkcharts/issues/49#issuecomment-302115522 . One needs to add a fake column with only one value in the DataFrame as in:


from bokeh.charts import BoxPlot, show, output_notebook
from bokeh.layouts import row
from bokeh.sampledata.autompg import autompg as df
df[ 'label'] = 1
box = BoxPlot( df, values='mpg', label='label', plot_width=400, color='your fav col')
output_notebook()
show(box)

alEx

On Wed, May 17, 2017 at 5:36 PM Paul Hobson [email protected] wrote:

You probably still need to assign some sort of label for the categorical axis. I’d first try an array of constant value. If that doesn’t work, try adding it as a new column to the flowers dataframe (or column data source?).
-Paul

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/CADT3MEAN33R5cU%2BeNgW6%2Bg6YhcU2v%3Dx2fvJ5Xs0aP047_M3T_A%40mail.gmail.com.

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

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/CAJjPzf_s5Q-DhCq8oOo7uW2NQ1i-PFXzTf%3DCtRQcoit1bE%2B6Vw%40mail.gmail.com.

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

On Wed, May 17, 2017 at 3:20 AM, Alex Schmitt [email protected] wrote:

I found this as an issue (#49 in bkcharts) : Closed ; And duplicate-open in bokeh #5868 !?

On Wed, May 17, 2017 at 9:27 AM Alex Schmitt [email protected] wrote:

Thanks Raphael,

I understand the error and made a new simple test which provide a javascrip error:


from bokeh.io import output_notebook, show

from bokeh.charts import BoxPlot

from bokeh.sampledata.iris import flowers

output_notebook()

works well

p = BoxPlot(flowers, label=‘species’, values=‘petal_width’, tools=‘crosshair’, color=’#aa4444’,

xlabel=’’, ylabel=‘petal width, mm’, title=‘Distributions of petal widths’)

show§

gives a javascript error

bp = BoxPlot( data=flowers, values=‘sepal_length’)

show( bp)


=> Javascript error adding output!

TypeError: Cannot read property ‘indexOf’ of null

See your browser Javascript console for more details.

And I really don’t know anything about javascript.

So what’s the heck ? Is there a way having only one BoxPlot when working with time series ? Or BoxPlot can’t figure out a singleton ?

Thanks

On Tue, May 16, 2017 at 10:07 PM Raphael Walker [email protected] wrote:

Hi Alex,

Try this:

```

a = None

b = a[0]

```



You will get an error like you have. That's a very common error and

without a running example it’s impossible to help.

Have a nice evening.



Raphael

On 2017-05-16 19:13, alEx S wrote:

Hi guys,

      The situation is really simple : I want a single boxplot

from a list of integers, and I don’t understand the error
message: TypeError: ‘NoneType’ object is not subscriptable.

data=ColumnDataSource( df)

bp = BoxPlot( data=data, values=‘values’)
show( bp)

with df.info() =>

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 726 entries, 0 to 725
Data columns (total 1 columns):
values 726 non-null int64
dtypes: int64(1)
memory usage: 5.8 KB


Any one got an idea ?
Thanks
alEx

  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/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/09fe5d59-7533-425c-a32d-d2f738953bd1%40continuum.io?utm_medium=email&utm_source=footer).

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

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/f5488c51-1ae0-7b3d-85a0-0f821001a869%40busino.ch.

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

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/CAJjPzf8qPezrtTKnDSGHMhxWKzCV7YC0d5an8k3zutm%2BgOrFvw%40mail.gmail.com.

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