(self)
return pandas.concat([node_df, edge_df])
Returns a pandas dataframe with the graph content.
Returns a pandas dataframe with the graph content.
Returns a pandas dataframe with the graph content .
def to_pandas(self):
        """Returns a pandas dataframe with the graph content."""
        if not self.resource_data:
            return pandas.DataFrame()

        data = self.resource_data
        elements = data.get('elements', {})
        nodes = elements.get('nodes', [])
        edges = elements.get('edges', [])

        node_list = [x.get('data') for x in nodes]
        edge_list = [x.get('data') for x in edges]
        node_df = pandas.DataFrame(node_list)
        node_df['type'] = 'node'
        edge_df = pandas.DataFrame(edge_list)
        edge_df['type'] = 'edge'
        return pandas.concat([node_df, edge_df])
def to_pandas ( self ) : if not self . resource_data : return pandas . DataFrame ( ) data = self . resource_data elements = data . get ( 'elements' , { } ) nodes = elements . get ( 'nodes' , [ ] ) edges = elements . get ( 'edges' , [ ] ) node_list = [ x . get ( 'data' ) for x in nodes ] edge_list = [ x . get ( 'data' ) for x in edges ] node_df = pandas . DataFrame ( node_list ) node_df [ 'type' ] = 'node' edge_df = pandas . DataFrame ( edge_list ) edge_df [ 'type' ] = 'edge' return pandas . concat ( [ node_df , edge_df ] )