I am trying to use Bokeh to build a Pandas frame with a DateTime column containing years and numeric. If the DateTime parameter is specified as x , the behavior is expected (years along the x axis). However, if I use set_index to turn the DateTime column into an index on the data frame, and then specify only y in the TimeSeries , I get the time in milliseconds along the x axis. Minimal example
import pandas as pd import numpy as np from bokeh.charts import TimeSeries, output_file, show output_file('fig.html') test = pd.DataFrame({'datetime':pd.date_range('1/1/1880', periods=2000),'foo':np.arange(2000)}) fig = TimeSeries(test,x='datetime',y='foo') show(fig) output_file('fig2.html') test = test.set_index('datetime') fig2 = TimeSeries(test,y='foo') show(fig2)
Is this the expected behavior or error? I would expect the same picture with both approaches.
Hooray!!
python pandas time-series bokeh
manu
source share