src/whylogs/core/statistics/numbertracker.py
def to_summary(self):
        """
        Construct a `NumberSummary` message

        Returns
        -------
        summary : NumberSummary
            Summary of the tracker statistics
        """
        if self.variance.count == 0:
            return

        stddev = self.variance.stddev()
        doubles = self.floats.to_protobuf()
        if doubles.count > 0:
            mean = self.floats.mean()
            min = doubles.min
            max = doubles.max
        else:
            mean = self.ints.mean()
            min = float(self.ints.min)
            max = float(self.ints.max)

        unique_count = self.theta_sketch.to_summary()
        histogram = histogram_from_sketch(self.histogram)
        quant = quantiles_from_sketch(self.histogram)
        frequent_numbers = self.frequent_numbers.to_summary()
        num_records = self.variance.count
        cardinality = unique_count.estimate
        discrete = stats.is_discrete(num_records, cardinality)

        return NumberSummary(
            count=self.variance.count,
            stddev=stddev,
            min=min,
            max=max,
            mean=mean,
            histogram=histogram,
            quantiles=quant,
            unique_count=unique_count,
            frequent_numbers=frequent_numbers,
            is_discrete=discrete,
        )

        Construct a `NumberSummary` message

        Returns
        -------
        summary : NumberSummary
            Summary of the tracker statistics
        
Construct a `NumberSummary` message
Returns

summary : NumberSummary
Summary of the tracker statistics
Construct a ` NumberSummary ` message Returns summary : NumberSummary Summary of the tracker statistics
def to_summary(self):
        if self.variance.count == 0:
            return
        stddev = self.variance.stddev()
        doubles = self.floats.to_protobuf()
        if doubles.count > 0:
            mean = self.floats.mean()
            min = doubles.min
            max = doubles.max
        else:
            mean = self.ints.mean()
            min = float(self.ints.min)
            max = float(self.ints.max)
        unique_count = self.theta_sketch.to_summary()
        histogram = histogram_from_sketch(self.histogram)
        quant = quantiles_from_sketch(self.histogram)
        frequent_numbers = self.frequent_numbers.to_summary()
        num_records = self.variance.count
        cardinality = unique_count.estimate
        discrete = stats.is_discrete(num_records, cardinality)
        return NumberSummary(
            count=self.variance.count,
            stddev=stddev,
            min=min,
            max=max,
            mean=mean,
            histogram=histogram,
            quantiles=quant,
            unique_count=unique_count,
            frequent_numbers=frequent_numbers,
            is_discrete=discrete,
        )
def to_summary ( self ) : if self . variance . count == 0 : return stddev = self . variance . stddev ( ) doubles = self . floats . to_protobuf ( ) if doubles . count > 0 : mean = self . floats . mean ( ) min = doubles . min max = doubles . max else : mean = self . ints . mean ( ) min = float ( self . ints . min ) max = float ( self . ints . max ) unique_count = self . theta_sketch . to_summary ( ) histogram = histogram_from_sketch ( self . histogram ) quant = quantiles_from_sketch ( self . histogram ) frequent_numbers = self . frequent_numbers . to_summary ( ) num_records = self . variance . count cardinality = unique_count . estimate discrete = stats . is_discrete ( num_records , cardinality ) return NumberSummary ( count = self . variance . count , stddev = stddev , min = min , max = max , mean = mean , histogram = histogram , quantiles = quant , unique_count = unique_count , frequent_numbers = frequent_numbers , is_discrete = discrete , )
Construct a `NumberSummary` message
Returns
Construct a ` NumberSummary ` message Returns
"""
        Construct a `NumberSummary` message

        Returns
        -------
        summary : NumberSummary
            Summary of the tracker statistics
        """
self