用法:
Graph.from_cudf_edgelist(input_df, source='source', destination='destination', edge_attr=None, renumber=True)
從邊列表初始化一個圖。在已初始化的 Graph 對象上調用此方法是錯誤的。傳遞的input_df 參數包裝了gdf_column 對象,這些對象表示使用邊列表格式的圖形。源參數是源列名,目標參數是目標列名。默認情況下,啟用重新編號以將源頂點和目標頂點映射到 [0, V) 範圍內的索引,其中 V 是頂點數。如果輸入頂點是 [0, V) 範圍內的單列整數,則可以禁用重新編號,並且將使用原始的外部頂點 ID。如果存在權重,edge_attr 參數是權重列名稱。
- input_df:cudf.DataFrame 或 dask_cudf.DataFrame
包含邊信息的 DataFrame 如果傳遞了 dask_cudf.DataFrame,它將被重新解釋為 cudf.DataFrame。對於分布式路徑,請使用from_dask_cudf_edgelist。
- source:str 或array-like,可選(默認='source')
源列名或列名數組
- destination:str 或array-like,可選(默認='destination')
目標列名或列名數組
- edge_attr:str 或無,可選(默認=無)
權重列名稱。
- renumber:布爾,可選(默認=真)
指示是否對源頂點 ID 和目標頂點 ID 重新編號。
參數:
例子:
>>> df = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ', ... dtype=['int32', 'int32', 'float32'], ... header=None) >>> G = cugraph.Graph() >>> G.from_cudf_edgelist(df, source='0', destination='1', ... edge_attr='2', renumber=False)
相關用法
- Python cugraph.Graph.from_cudf_adjlist用法及代碼示例
- Python cugraph.Graph.from_pandas_edgelist用法及代碼示例
- Python cugraph.Graph.to_directed用法及代碼示例
- Python cugraph.Graph.to_undirected用法及代碼示例
- Python cugraph.Graph用法及代碼示例
- 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.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用法及代碼示例
- Python cugraph.centrality.betweenness_centrality.edge_betweenness_centrality用法及代碼示例
- Python cugraph.link_prediction.woverlap.overlap_w用法及代碼示例
- Python cugraph.link_prediction.overlap.overlap用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cugraph.Graph.from_cudf_edgelist。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。