Cannot run HeatMap example in latest bokeh

I’m trying to recreate the HeatMap example from Using High-level Charts — Bokeh 0.9.3 documentation

rom bokeh.charts import HeatMap, output_file, show

import pandas as pd

output_file('heatmap.html')

df = pd.DataFrame(
        dict(
            apples=[4, 5, 8],
            bananas=[1, 2, 4],
            pears=[6, 5, 4],
        ),
        index=['2012', '2013', '2014']
    )

p = HeatMap(df, title='Fruits')

show(p)

Unfortunately, it doesn’t plot correctly on 0.14.3

How can I use a dataframe on bokeh?

Thanks,

Jose

Hi,

Please examine the URL you are looking at. You are looking at *very* old documentation. The bokeh.charts interface underwent significant changes about a year ago. Please always try to make sure you are looking at the correct documentation for the version you have installed.

As it happens, the new version of HeatMap has not made it into the documentation site yet. This is regrettable but the core team is very over-committed at present (any help and contribution is appreciated). However, the examples are always kept up to date, and you can see one here:

  https://github.com/bokeh/bokeh/blob/master/examples/charts/file/heatmap.py

Thanks,

Bryan

···

On Nov 4, 2016, at 3:56 PM, [email protected] wrote:

I'm trying to recreate the HeatMap example from Using High-level Charts — Bokeh 0.9.3 documentation

rom bokeh.charts import HeatMap, output_file, show

import pandas as pd

output_file('heatmap.html')

df = pd.DataFrame(

dict(

apples=[4, 5, 8],

bananas=[1, 2, 4],

pears=[6, 5, 4],

),

index=['2012', '2013', '2014']

)

p = HeatMap(df, title='Fruits')

show(p)

Unfortunately, it doesn't plot correctly on 0.14.3

How can I use a dataframe on bokeh?

Thanks,
Jose

--
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/512520cf-5d15-4e75-b8b4-08ec5e260ab8%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.