本文整理汇总了Python中holoviews.core.spaces.DynamicMap.reindex方法的典型用法代码示例。如果您正苦于以下问题:Python DynamicMap.reindex方法的具体用法?Python DynamicMap.reindex怎么用?Python DynamicMap.reindex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类holoviews.core.spaces.DynamicMap
的用法示例。
在下文中一共展示了DynamicMap.reindex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dynamic_reindex_drop_raises_exception
# 需要导入模块: from holoviews.core.spaces import DynamicMap [as 别名]
# 或者: from holoviews.core.spaces.DynamicMap import reindex [as 别名]
def test_dynamic_reindex_drop_raises_exception(self):
def history_callback(x, y, history=deque(maxlen=10)):
history.append((x, y))
return Points(list(history))
dmap = DynamicMap(history_callback, kdims=['x', 'y'])
exception = ("DynamicMap does not allow dropping dimensions, "
"reindex may only be used to reorder dimensions.")
with self.assertRaisesRegexp(ValueError, exception):
dmap.reindex(['x'])
示例2: test_dynamic_reindex_reorder
# 需要导入模块: from holoviews.core.spaces import DynamicMap [as 别名]
# 或者: from holoviews.core.spaces.DynamicMap import reindex [as 别名]
def test_dynamic_reindex_reorder(self):
def history_callback(x, y, history=deque(maxlen=10)):
history.append((x, y))
return Points(list(history))
dmap = DynamicMap(history_callback, kdims=['x', 'y'])
reindexed = dmap.reindex(['y', 'x'])
points = reindexed[2, 1]
self.assertEqual(points, Points([(1, 2)]))