cugraph.experimental.PropertyGraph.get_edge_data#

PropertyGraph.get_edge_data(edge_ids=None, types=None, columns=None)[source]#

Return a dataframe containing edge properties for only the specified edge_ids, columns, and/or edge type, or all edge IDs if not specified.

Parameters:
edge_idsint or collection of int, optional

The list of edges to include in the edge data

typeslist, optional

List of edge types to include in returned dataframe. None is the default and will return all edge types.

columnswhich edge columns will be returned, optional

None is the default and will result in all columns being returned

Returns:
Dataframe

Containing edge ids, type edge source, destination and all the columns specified in the columns parameter

Examples

>>> import cudf
>>> import cugraph
>>> from cugraph.experimental import PropertyGraph
>>> df = cudf.DataFrame(columns=["src", "dst", "some_property"],
...                     data=[(99, 22, "a"),
...                           (98, 34, "b"),
...                           (97, 56, "c"),
...                           (96, 88, "d"),
...                          ])
>>> pG = PropertyGraph()
>>> pG.add_edge_data(df, type_name="etype", vertex_col_names=("src", "dst"))
>>> pG.get_edge_data(types="etype").sort_index(axis=1)
_DST_  _EDGE_ID_  _SRC_ _TYPE_ some_property
0     22          0     99  etype             a
1     34          1     98  etype             b
2     56          2     97  etype             c
3     88          3     96  etype             d