Lets say I have the following data:
import random
import pandas as pd
numbers = random.sample(range(1,50), 12)
d = {'month': range(1,13),'values':numbers}
df = pd.DataFrame(d)
I am using bokeh to visualize the results:
p = figure(plot_width=400, plot_height=400)
p.line(df['month'], df['values'], line_width=2)
output_file('test.html')
show(p)
The results are ok. What I want is the x axis to represent a month(1:January,2:February..). I am doing the following to convert the numbers to months:
import datetime
df['month'] = [datetime.date(1900, x, 1).strftime('%B') for x in df['month']]
p = figure(plot_width=400, plot_height=400)
p.line(df['month'], df['values'], line_width=2)
show(p)
The results is an empty figure. The following is also not working:
p.xaxis.formatter = DatetimeTickFormatter(format="%B")
Any idea how to overpass it?

