用法:
cugraph.structure.convert_matrix.from_edgelist(df, source='source', destination='destination', edge_attr=None, create_using=<class 'cugraph.structure.graph_classes.Graph'>, renumber=True)
返回从边列表表示创建的新图。
- df:cudf.DataFrame, pandas.DataFrame, dask_cudf.core.DataFrame
此 DataFrame 包含存储边源顶点、目标(或遵循 NetworkX 术语的目标)顶点和(可选)权重的列。
- source:字符串或整数,可选(默认='source')
这用于索引源列。
- destination:字符串或整数,可选(默认='destination')
这用于索引目标(或 NetworkX 术语之后的目标)列。
- edge_attr:字符串或整数,可选(默认=无)
该指针可以是
None
。如果不是,则用于索引权重列。- create_using:cuGraph.Graph,可选(默认=cugraph.Graph)
指定要创建的图表类型。
- renumber:布尔,可选(默认=真)
如果源索引和目标索引不在 0 到 V 的范围内,其中 V 是顶点数,则重新编号参数应为 True。
参数:
例子:
>>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ', ... dtype=['int32', 'int32', 'float32'], header=None) >>> G = cugraph.Graph() >>> G = cugraph.from_edgelist(M, source='0', destination='1', ... edge_attr='2')
相关用法
- Python cugraph.structure.convert_matrix.from_pandas_edgelist用法及代码示例
- Python cugraph.structure.convert_matrix.from_adjlist用法及代码示例
- Python cugraph.structure.convert_matrix.from_cudf_edgelist用法及代码示例
- Python cugraph.structure.symmetrize.symmetrize_df用法及代码示例
- Python cugraph.structure.symmetrize.symmetrize_ddf用法及代码示例
- Python cugraph.structure.symmetrize.symmetrize用法及代码示例
- Python cugraph.sampling.random_walks.random_walks用法及代码示例
- Python cugraph.community.spectral_clustering.spectralBalancedCutClustering用法及代码示例
- Python cugraph.link_prediction.jaccard.jaccard用法及代码示例
- Python cugraph.link_prediction.wjaccard.jaccard_w用法及代码示例
- Python cugraph.community.ecg.ecg用法及代码示例
- Python cugraph.Graph.from_cudf_adjlist用法及代码示例
- Python cugraph.community.louvain.louvain用法及代码示例
- Python cugraph.tree.minimum_spanning_tree.maximum_spanning_tree用法及代码示例
- Python cugraph.centrality.betweenness_centrality.betweenness_centrality用法及代码示例
- Python cugraph.link_analysis.pagerank.pagerank用法及代码示例
- Python cugraph.dask.community.louvain.louvain用法及代码示例
- Python cugraph.traversal.bfs.bfs用法及代码示例
- Python cugraph.community.egonet.batched_ego_graphs用法及代码示例
- Python cugraph.tree.minimum_spanning_tree.minimum_spanning_tree用法及代码示例
注:本文由纯净天空筛选整理自rapids.ai大神的英文原创作品 cugraph.structure.convert_matrix.from_edgelist。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。