用法:
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。