cugraph.experimental.PropertyGraph.has_duplicate_edges#

classmethod PropertyGraph.has_duplicate_edges(df, columns=None)[source]#

Return True if df has rows with the same src, dst, type, and columns

Parameters:
dfdataframe

Containing the edges to test test for duplicates

columnslist of strings, optional

List of column names to use when testing for duplicate edges in addition to source, destination and type.

Returns:
bool

True if df has multiple rows with the same source, destination and type plus columns that are specified.

Examples

>>> import cugraph
>>> import cudf
>>> 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"))
>>> PropertyGraph.has_duplicate_edges(pG.get_edge_data())
False