作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在学习带有 Bokeh 后端的 HoloViews,并且正在制作 Pandas 数据帧所选列的 iPython/Jupyter 显示(实际上它是一个 xarray 数据集,但用数据帧显示问题更简单)。问题是,当我选择第一列/变量以外的任何列/变量时,悬停工具提示仍显示第一列/变量的值。我的代码大致基于 HoloViews dashboard docs .
import holoviews as hv
import pandas as pd
import numpy as np
hv.extension('bokeh')
df = pd.DataFrame()
df['time'] = pd.date_range('2018-01-01', '2018-01-31')
df['var1'] = np.linspace(0, 1, len(df['time']))
df['var2'] = np.ones(df['var1'].shape)
def load_symbol(var):
return hv.Curve(df, ('time', 'Time'), var)
variables = ['var1', 'var2']
dmap = hv.DynamicMap(load_symbol, kdims='Variable').redim.values(Variable=variables)
dmap.opts(framewise=True, tools=['hover'])
最佳答案
显然这是全息 View 中的一个错误,正如开发人员回答的那样 here (issue #3609)
它在 holoviews 1.12.2 版本中得到了正式解决。
如果有人仍然遇到这个问题,升级到最新版本应该可以解决它。
关于python - HoloViews DynamicMap 悬停工具不会使用所选变量更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55288470/
我正在尝试用 Swift 编写这段 JavaScript 代码:k_combinations 到目前为止,我在 Swift 中有这个: import Foundation import Cocoa e
我是一名优秀的程序员,十分优秀!