plot hierarchical index?

I have attached a jupyter notebook showing the example - but is it possible to plot a hierarchical axis similar to the link I have attached in the notebook? Currently what I have done is pop the index out and make it into columns in the dataframe.

plot_question_axis.ipynb (103 KB)

I suppose I have a few questions here:

As written before, can one make a multi-level index look like:

http://news.infragistics.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/265/4718.Capture.PNG

In the example I attached in the previous example, I tried:

p_base = Bar(final_output, values=‘nps’, label=[‘work_location’, ‘month’])

show(p_base)

But the “values” argument has only some fixed values.

when using pandas I can aggregate by using a customer agg function such as:

df_base.groupby([‘work_location’, ‘month’]).agg({‘nps’: nps})

(as seen in the example.)

Is it possible to pass a custom aggregation function. I have tried several ways and don’t seem to be able to.

I was just trying to Directly plot with Bar without having to first do this:

df_base.groupby([‘work_location’, ‘month’]).agg({‘nps’: nps})

then .reset_index() to pull the index out into columns.

···

On Tue, May 24, 2016 at 4:44 PM jared [email protected] wrote:

I have attached a jupyter notebook showing the example - but is it possible to plot a hierarchical axis similar to the link I have attached in the notebook? Currently what I have done is pop the index out and make it into columns in the dataframe.

Apologies in advance if I’ve misunderstood somthing.

I don’t believe th at
the pre-baked charts support multi-level labels ,
although that is something
you can achieve with bokeh a little more manually:

                    I think that would be a

nice feature, al though it does sound
like a tricky one. Maybe you can add a
feature request on github?

···

http://bokeh.pydata.org/en/0.11.1/docs/user_guide/plotting.html#twin-axes
On 5/24/16 1:58 PM, jared wrote:

I suppose I have a few questions here:

      As written before, can one make a multi-level index look

like:

http://news.infragistics.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/265/4718.Capture.PNG

In the example I attached in the previous example, I tried:

        p_base = Bar(final_output, values='nps',

label=[‘work_location’, ‘month’])

show(p_base)

But the “values” argument has only some fixed values.

      when using pandas I can aggregate by using a customer agg

function such as:

      df_base.groupby(['work_location', 'month']).agg({'nps':

nps})

(as seen in the example.)

      Is it possible to pass a custom aggregation function.  I

have tried several ways and don’t seem to be able to.

      I was just trying to Directly plot with Bar without having

to first do this:

      df_base.groupby(['work_location', 'month']).agg({'nps':

nps})

then .reset_index() to pull the index out into columns.

On Tue, May 24, 2016 at 4:44 PM jared < >
wrote:

        I have attached a jupyter notebook showing the

example - but is it possible to plot a hierarchical axis
similar to the link I have attached in the notebook?
Currently what I have done is pop the index out and make it
into columns in the dataframe.

  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/CADss3AQst5kQ6X3QDExbvHFy%3Drtbc--591_Po%2B%3DO0f%3DDkByCCQ%40mail.gmail.com?utm_medium=email&utm_source=footer)      .

For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

[email protected]
https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADss3AQst5kQ6X3QDExbvHFy%3Drtbc–591_Po%2B%3DO0f%3DDkByCCQ%40mail.gmail.com
https://groups.google.com/a/continuum.io/d/optout

Yes, a pre-requisite to doing this "for real" is to rework the "categorical coordinates" notion, and to properly support nested or hierarchical coordinate systems. I thought there was already an issue for this, but I can't find one, so I'd agree that a feature request is appropriate. This will be a fairly large chunk of new work, which probably won't be able to happen until later this year. For the time being I'm afraid the "manual twin-axis approach" is your best bet.

Thanks,

Bryan

···

On May 25, 2016, at 10:47 AM, Sarah Bird - Continuum <[email protected]> wrote:

Apologies in advance if I've misunderstood somthing.

I don't believe that the pre-baked charts support multi-level labels, although that is something you can achieve with bokeh a little more manually: http://bokeh.pydata.org/en/0.11.1/docs/user_guide/plotting.html#twin-axes

I think that would be a nice feature, although it does sound like a tricky one. Maybe you can add a feature request on github?

On 5/24/16 1:58 PM, jared wrote:

I suppose I have a few questions here:

1.
As written before, can one make a multi-level index look like:
http://news.infragistics.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/265/4718.Capture.PNG

2.
In the example I attached in the previous example, I tried:
p_base = Bar(final_output, values='nps', label=['work_location', 'month'])
show(p_base)

But the "values" argument has only some fixed values.
when using pandas I can aggregate by using a customer agg function such as:
df_base.groupby(['work_location', 'month']).agg({'nps': nps})
(as seen in the example.)

Is it possible to pass a custom aggregation function. I have tried several ways and don't seem to be able to.

I was just trying to Directly plot with Bar without having to first do this:
df_base.groupby(['work_location', 'month']).agg({'nps': nps})
then .reset_index() to pull the index out into columns.

On Tue, May 24, 2016 at 4:44 PM jared <[email protected]> wrote:
I have attached a jupyter notebook showing the example - but is it possible to plot a hierarchical axis similar to the link I have attached in the notebook? Currently what I have done is pop the index out and make it into columns in the dataframe.


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/CADss3AQst5kQ6X3QDExbvHFy%3Drtbc--591_Po%2B%3DO0f%3DDkByCCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
Sarah Bird
Developer, Bokeh

--
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/c0f90987-f2d3-83a7-abeb-da081878358c%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.