turicreate.SGraph.get_fields — Turi Create API 6.4.1 documentation (original) (raw)

SGraph. get_fields()

Return a list of vertex and edge attribute fields in the SGraph. If a field is common to both vertex and edge attributes, it will show up twice in the returned list.

Returns: out : list Names of fields contained in the vertex or edge data.

Examples

from turicreate import SGraph, Vertex, Edge g = SGraph() verts = [Vertex(0, attr={'name': 'alex'}), Vertex(1, attr={'name': 'barbara'})] g = g.add_vertices(verts) g = g.add_edges(Edge(0, 1, attr={'frequency': 6})) fields = g.get_fields() ['__id', 'name', '__src_id', '__dst_id', 'frequency']