class turicreate.Edge(src_vid, dst_vid, attr={}, _series=None)

A directed edge between two Vertex objects. An Edge object consists of a source vertex ID, a destination vertex ID, and a dictionary of edge attributes.

src_vid : int or string or float

Source vertex ID.

dst_vid : int or string or float

Target vertex ID.

attr : dict

Edge attributes. A Dictionary of string keys and values with one of the following types: integer, float, string, array of floats.

See also

Vertex, SGraph


>>> from turicreate import SGraph, Vertex, Edge
>>> verts = [Vertex(0, attr={'breed': 'labrador'}),
             Vertex(1, attr={'breed': 'vizsla'})]
>>> edges = [Edge(0, 1, attr={'size': 'larger_than'})]
>>> g = SGraph()
>>> g = g.add_vertices(verts).add_edges(edges)