def stats(self, ops=(min, max, np.median, sum)):
        """Compute statistics for each column and place them in a table."""
        names = [op.__name__ for op in ops]
        ops = [_zero_on_type_error(op) for op in ops]
        columns = [[op(column) for op in ops] for column in self.columns]
        table = type(self)().with_columns(zip(self.labels, columns))
        stats = table._unused_label('statistic')
        table[stats] = names
        table.move_to_start(stats)
        return table
def stats ( self , ops = ( min , max , np . median , sum ) ) : names = [ op . __name__ for op in ops ] ops = [ _zero_on_type_error ( op ) for op in ops ] columns = [ [ op ( column ) for op in ops ] for column in self . columns ] table = type ( self ) ( ) . with_columns ( zip ( self . labels , columns ) ) stats = table . _unused_label ( 'statistic' ) table [ stats ] = names table . move_to_start ( stats ) return table
Compute statistics for each column and place them in a table.