hatchet/graphframe.py
def unify(self, other):
        """Returns a unified graphframe.

        Ensure self and other have the same graph and same node IDs. This may
        change the node IDs in the dataframe.

        Update the graphs in the graphframe if they differ.
        """
        if self.graph is other.graph:
            return

        node_map = {}
        union_graph = self.graph.union(other.graph, node_map)

        self_index_names = self.dataframe.index.names
        other_index_names = other.dataframe.index.names

        self.dataframe.reset_index(inplace=True)
        other.dataframe.reset_index(inplace=True)

        self.dataframe["node"] = self.dataframe["node"].apply(lambda x: node_map[id(x)])
        other.dataframe["node"] = other.dataframe["node"].apply(
            lambda x: node_map[id(x)]
        )

        self.dataframe.set_index(self_index_names, inplace=True, drop=True)
        other.dataframe.set_index(other_index_names, inplace=True, drop=True)

        # add missing rows to copy of self's dataframe in preparation for
        # operation
        self._insert_missing_rows(other)

        self.graph = union_graph
        other.graph = union_graph
Returns a unified graphframe.

        Ensure self and other have the same graph and same node IDs. This may
        change the node IDs in the dataframe.

        Update the graphs in the graphframe if they differ.
        
Returns a unified graphframe.
Ensure self and other have the same graph and same node IDs. This may
change the node IDs in the dataframe.

Update the graphs in the graphframe if they differ.
Returns a unified graphframe . Ensure self and other have the same graph and same node IDs . This may change the node IDs in the dataframe . Update the graphs in the graphframe if they differ .
def unify(self, other):
        if self.graph is other.graph:
            return
        node_map = {}
        union_graph = self.graph.union(other.graph, node_map)
        self_index_names = self.dataframe.index.names
        other_index_names = other.dataframe.index.names
        self.dataframe.reset_index(inplace=True)
        other.dataframe.reset_index(inplace=True)
        self.dataframe["node"] = self.dataframe["node"].apply(lambda x: node_map[id(x)])
        other.dataframe["node"] = other.dataframe["node"].apply(
            lambda x: node_map[id(x)]
        )
        self.dataframe.set_index(self_index_names, inplace=True, drop=True)
        other.dataframe.set_index(other_index_names, inplace=True, drop=True)
        self._insert_missing_rows(other)
        self.graph = union_graph
        other.graph = union_graph
def unify ( self , other ) : if self . graph is other . graph : return node_map = { } union_graph = self . graph . union ( other . graph , node_map ) self_index_names = self . dataframe . index . names other_index_names = other . dataframe . index . names self . dataframe . reset_index ( inplace = True ) other . dataframe . reset_index ( inplace = True ) self . dataframe [ "node" ] = self . dataframe [ "node" ] . apply ( lambda x : node_map [ id ( x ) ] ) other . dataframe [ "node" ] = other . dataframe [ "node" ] . apply ( lambda x : node_map [ id ( x ) ] ) self . dataframe . set_index ( self_index_names , inplace = True , drop = True ) other . dataframe . set_index ( other_index_names , inplace = True , drop = True ) self . _insert_missing_rows ( other ) self . graph = union_graph other . graph = union_graph
Returns a unified graphframe.
Returns a unified graphframe .
"""Returns a unified graphframe.

        Ensure self and other have the same graph and same node IDs. This may
        change the node IDs in the dataframe.

        Update the graphs in the graphframe if they differ.
        """ # add missing rows to copy of self's dataframe in preparation for # operation
self
other