hatchet/graphframe.py
def subtree_sum(self, columns, out_columns=None, function=np.sum):
        """Compute sum of elements in subtrees.  Valid only for trees.

        For each row in the graph, ``out_columns`` will contain the
        element-wise sum of all values in ``columns`` for that row's node
        and all of its descendants.

        This algorithm will multiply count nodes with in-degree higher
        than one -- i.e., it is only correct for trees.  Prefer using
        ``subgraph_sum`` (which calls ``subtree_sum`` if it can), unless
        you have a good reason not to.

        Arguments:
            columns (list of str): names of columns to sum (default: all columns)
            out_columns (list of str): names of columns to store results
                (default: in place)
            function (callable): associative operator used to sum
                elements (default: sum)

        """
        out_columns = self._init_sum_columns(columns, out_columns)

        # sum over the output columns
        for node in self.graph.traverse(order="post"):
            if node.children:
                self.dataframe.loc[node, out_columns] = function(
                    self.dataframe.loc[[node] + node.children, out_columns]
                )
Compute sum of elements in subtrees.  Valid only for trees.

        For each row in the graph, ``out_columns`` will contain the
        element-wise sum of all values in ``columns`` for that row's node
        and all of its descendants.

        This algorithm will multiply count nodes with in-degree higher
        than one -- i.e., it is only correct for trees.  Prefer using
        ``subgraph_sum`` (which calls ``subtree_sum`` if it can), unless
        you have a good reason not to.

        Arguments:
            columns (list of str): names of columns to sum (default: all columns)
            out_columns (list of str): names of columns to store results
                (default: in place)
            function (callable): associative operator used to sum
                elements (default: sum)

        
Compute sum of elements in subtrees.  Valid only for trees.

This algorithm will multiply count nodes with in-degree higher
than one -- i.e., it is only correct for trees.
Compute sum of elements in subtrees . Valid only for trees . This algorithm will multiply count nodes with in - degree higher than one -- i . e . it is only correct for trees .
def subtree_sum(self, columns, out_columns=None, function=np.sum):
        out_columns = self._init_sum_columns(columns, out_columns)
        for node in self.graph.traverse(order="post"):
            if node.children:
                self.dataframe.loc[node, out_columns] = function(
                    self.dataframe.loc[[node] + node.children, out_columns]
                )
def subtree_sum ( self , columns , out_columns = None , function = np . sum ) : out_columns = self . _init_sum_columns ( columns , out_columns ) for node in self . graph . traverse ( order = "post" ) : if node . children : self . dataframe . loc [ node , out_columns ] = function ( self . dataframe . loc [ [ node ] + node . children , out_columns ] )
Compute sum of elements in subtrees.
Compute sum of elements in subtrees .
"""Compute sum of elements in subtrees.  Valid only for trees.

        For each row in the graph, ``out_columns`` will contain the
        element-wise sum of all values in ``columns`` for that row's node
        and all of its descendants.

        This algorithm will multiply count nodes with in-degree higher
        than one -- i.e., it is only correct for trees.  Prefer using
        ``subgraph_sum`` (which calls ``subtree_sum`` if it can), unless
        you have a good reason not to.

        Arguments:
            columns (list of str): names of columns to sum (default: all columns)
            out_columns (list of str): names of columns to store results
                (default: in place)
            function (callable): associative operator used to sum
                elements (default: sum)

        """ # sum over the output columns
self
columns
names of columns to sum (default: all columns)
names of columns to sum ( default : all columns )
out_columns
names of columns to store results
(default: in place)
names of columns to store results ( default : in place )
function
associative operator used to sum
elements (default: sum)
associative operator used to sum elements ( default : sum )