(self)
return len(self)
Return the total weight of instances in the table, or their number if
        they are unweighted.
Return the total weight of instances in the table, or their number if
        they are unweighted.
Return the total weight of instances in the table or their number if they are unweighted .
def total_weight(self):
        """
        Return the total weight of instances in the table, or their number if
        they are unweighted.
        """
        if self.W.shape[-1]:
            return sum(self.W)
        return len(self)
def total_weight ( self ) : if self . W . shape [ - 1 ] : return sum ( self . W ) return len ( self )