Dataframe columns name type


I’m planning to do some charts from a dataframe which columns’ names are Timestamps. Pandas work well with that but Bokeh doesn’t accept this kind of column names apparently.

Sample code:

from datetime import datetime, timedelta

from bokeh.plotting import figure

from import output_notebook

import numpy as np

import pandas as pd


todays_date =

dates = pd.date_range(todays_date-timedelta(5), periods=5, freq=‘D’)

maturities = pd.date_range(todays_date, periods=12, freq=‘M’)

m = maturities[6]

d = dates[2]
data = pd.DataFrame(np.random.randn(12,5), index=maturities, columns=dates)

p = Line(data=data, x=‘index’, y=d)


Output (tail):

ValueError: expected an element of either Column Name or Column String or List(Column Name or Column String), got Timestamp(‘2015-11-02 00:00:00’, offset=‘D’)


Is this expected behavior or a case that Bokeh doesn't handle yet but should?

As a consequence, I have a few related questions about possible inputs:

- this doesn't work either and I don't understand why not: "p = Line(x=data.index, y=data[d].values)"
- what is the difference between a column name or column string?
- can bokeh handle multi-level columns?