用法:
classmethod load_graph(graph)
从图形对象的 cudf.DataFrame/dask_cudf.DataFrame (zero-copy 参考) 创建一个 cuxfilter.DataFrame
- tuple object (nodes, edges) where nodes and edges are cudf DataFrames:
- cuxfilter.DataFrame 对象
参数:
返回:
例子:
从 cugraph 对象加载图形
>>> import cuxfilter >>> import cudf, cugraph >>> edges = cudf.DataFrame( >>> { >>> 'source': [0, 1, 2, 3, 4], >>> 'target':[0,1,2,3,4], >>> 'weight':[4,4,2,6,7], >>> } >>> ) >>> G = cugraph.Graph() >>> G.from_cudf_edgelist(edges, destination='target') >>> cux_df = cuxfilter.DataFrame.load_graph((G.nodes(), G.edges()))
从(节点,边)加载图
>>> import cuxfilter >>> import cudf >>> nodes = cudf.DataFrame( >>> { >>> 'vertex': [0, 1, 2, 3, 4], >>> 'x':[0,1,2,3,4], >>> 'y':[4,4,2,6,7], >>> 'attr': [0,1,1,1,1] >>> } >>> ) >>> edges = cudf.DataFrame( >>> { >>> 'source': [0, 1, 2, 3, 4], >>> 'target':[0,1,2,3,4], >>> 'weight':[4,4,2,6,7], >>> } >>> ) >>> cux_df = cuxfilter.DataFrame.load_graph((nodes,edges))
相关用法
- Python cuxfilter.dataframe.DataFrame.from_dataframe用法及代码示例
- Python cuxfilter.dataframe.DataFrame.from_arrow用法及代码示例
- Python cuxfilter.dataframe.DataFrame.dashboard用法及代码示例
- Python cuxfilter.dashboard.DashBoard.add_charts用法及代码示例
- Python cuxfilter.dashboard.DashBoard.preview用法及代码示例
- Python cuxfilter.dashboard.DashBoard用法及代码示例
- Python cuxfilter.dashboard.DashBoard.app用法及代码示例
- Python cuxfilter.dashboard.DashBoard.export用法及代码示例
- Python cuxfilter.dashboard.DashBoard.show用法及代码示例
- Python cuxfilter.charts.datashader.heatmap用法及代码示例
- Python cuxfilter.charts.panel_widgets.int_slider用法及代码示例
- Python cuxfilter.charts.datashader.line用法及代码示例
- Python cuxfilter.charts.panel_widgets.float_slider用法及代码示例
- Python cuxfilter.charts.panel_widgets.multi_select用法及代码示例
- Python cuxfilter.charts.datashader.graph用法及代码示例
- Python cuxfilter.charts.bokeh.bar用法及代码示例
- Python cuxfilter.charts.panel_widgets.card用法及代码示例
- Python cuxfilter.charts.panel_widgets.date_range_slider用法及代码示例
- Python cuxfilter.charts.panel_widgets.range_slider用法及代码示例
- Python cuxfilter.charts.datashader.scatter用法及代码示例
注:本文由纯净天空筛选整理自rapids.ai大神的英文原创作品 cuxfilter.dataframe.DataFrame.load_graph。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。