Consider the following code:
from datetime import datetime as dt
from bokeh.io import output_file, show
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource
output_file("plot_dates.html")
p = figure(x_axis_type='datetime')
data = dict(
dates=[dt(2015, 1, 1), dt(2015, 1, 2), dt(2015, 1, 3)],
values=[1,2,3])
source = ColumnDataSource(data)
p.line('dates', 'values', source=source)
show(p)
This displays a line correcty.
If now I want to skip a point, e.g. the second I had hoped that setting an element either in dates
or in values
(or in both), would result in a point being skipped.
Unfortunately, that is not the case, but None
is displayed as it was "0", which translates to 1970-01-01 in the case of the dates. Is there a simple way to skip data or must this be done by hand (or through a separate library)?
I know this could be done more or less easily using pandas
for filtering out the rows/columns containing None
elements, but I cannot use that.