MCPcopy Create free account
hub / github.com/alibaba/GraphScope / to_dataframe

Method to_dataframe

python/graphscope/framework/graph.py:443–465  ·  view source on GitHub ↗

Select some elements of the graph and output as a pandas.DataFrame Args: selector (dict): Select some portions of graph. vertex_range (dict, optional): Slice vertices. Defaults to None. Returns: :class:`graphscope.framework.context.ResultDAGNode`

(self, selector, vertex_range=None)

Source from the content-addressed store, hash-verified

441 return ResultDAGNode(self, op)
442
443 def to_dataframe(self, selector, vertex_range=None):
444 """Select some elements of the graph and output as a pandas.DataFrame
445
446 Args:
447 selector (dict): Select some portions of graph.
448 vertex_range (dict, optional): Slice vertices. Defaults to None.
449
450 Returns:
451 :class:`graphscope.framework.context.ResultDAGNode`:
452 A result holds the `pandas.DataFrame`, evaluated in eager mode.
453 """
454 # avoid circular import
455 from graphscope.framework.context import ResultDAGNode
456
457 check_argument(self.graph_type == graph_def_pb2.ARROW_PROPERTY)
458 check_argument(
459 isinstance(selector, Mapping),
460 "selector of to dataframe must be a dict",
461 )
462 selector = json.dumps(selector)
463 vertex_range = utils.transform_vertex_range(vertex_range)
464 op = dag_utils.graph_to_dataframe(self, selector, vertex_range)
465 return ResultDAGNode(self, op)
466
467 def to_directed(self):
468 op = dag_utils.to_directed(self)

Callers

nothing calls this directly

Calls 2

check_argumentFunction · 0.90
ResultDAGNodeClass · 0.90

Tested by

no test coverage detected