pandas-bokeh

Bokeh update map tooltip using select or slider

不打扰是莪最后的温柔 提交于 2021-01-29 13:01:07
问题 I am trying to update a worldmap tooltip using a slicer or dropdown select. I got following question which sorted the most of the stuff for a Bokeh Slider custom JS callback import pandas as pd import random from datetime import timedelta df = pd.DataFrame({'base' : ["2017-01-01" for t in range(10000)], 'Date' : [random.randint(0, 1035) for t in range(10000)], 'Sales' : [random.random() for t in range(10000)]}) df['base'] = pd.to_datetime(df['base']) df["Date2"] = df.apply(lambda x: x["base"]

Bokeh Server plot not updating as wanted, also it keeps shifting and axis information vanishes

一曲冷凌霜 提交于 2021-01-29 10:00:30
问题 I want the plot to update, once I click the "refresh button", with the new data. But the old data stays in the plot, also it keeps shifting down right and the ticks vanish. At the beginning, the plot looks what I expected ( except the X axis information. As a side problem, I I looked up DataSpec() in Bokeh properties but not sure how to pass the accept_datetime=False to the x argument in the line plot. My code kind of looks like this. ) The data directory looks like root-| |-weeklydata1.pkl |

Change pandas plotting backend to get interactive plots instead of matplotlib static plots

我的未来我决定 提交于 2020-12-05 05:29:44
问题 When I use pandas df.plot() it has matplotlib as a default plotting backend. But this creates static plots. I would like interactive plots, so I have to change the pandas plotting background. How do I do change the plotting backend of pandas to have a different library creating my plots when i use .plot()? 回答1: You need pandas >= 0.25 to change the plotting backend of pandas. The available plotting backends are: matplotlib hvplot >= 0.5.1 holoviews pandas_bokeh plotly >= 4.8 altair So, the

Unable to clear multi-line figure with callback

走远了吗. 提交于 2019-12-04 05:12:24
问题 I have a figure with a line plot and another one with a multi-line plot. The plot updates when a user selects a new option from a Select object. The line plot updates correctly as is syncd with a ColumnDataSource. However, the multi-line plot pulls the info from a pandas dataframe. The problem is that the lines accumulate on the multi-line plot every time I select a new option. I tried to use this within the on_change callback function but won't work: select.js_on_change('value',CustomJS(args

Unable to clear multi-line figure with callback

我只是一个虾纸丫 提交于 2019-12-02 04:29:55
I have a figure with a line plot and another one with a multi-line plot. The plot updates when a user selects a new option from a Select object. The line plot updates correctly as is syncd with a ColumnDataSource. However, the multi-line plot pulls the info from a pandas dataframe. The problem is that the lines accumulate on the multi-line plot every time I select a new option. I tried to use this within the on_change callback function but won't work: select.js_on_change('value',CustomJS(args=dict(plot=plot), code="""plot.reset.emit()""")) I actually should include the CustomJS within my