StopAsyncIteration

exception StopAsyncIteration Must be raised by __anext__() method of an asynchronous iterator object to stop the iteration. New in version 3.5.

statistics.variance()

statistics.variance(data, xbar=None) Return the sample variance of data, an iterable of at least two real-valued numbers. Variance, or second moment about the mean, is a measure of the variability (spread or dispersion) of data. A large variance indicates that the data is spread out; a small variance indicates it is clustered closely around the mean. If the optional second argument xbar is given, it should be the mean of data. If it is missing or None (the default), the mean is automatically

statistics.stdev()

statistics.stdev(data, xbar=None) Return the sample standard deviation (the square root of the sample variance). See variance() for arguments and other details. >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75]) 1.0810874155219827

statistics.StatisticsError

exception statistics.StatisticsError Subclass of ValueError for statistics-related exceptions.

statistics.pvariance()

statistics.pvariance(data, mu=None) Return the population variance of data, a non-empty iterable of real-valued numbers. Variance, or second moment about the mean, is a measure of the variability (spread or dispersion) of data. A large variance indicates that the data is spread out; a small variance indicates it is clustered closely around the mean. If the optional second argument mu is given, it should be the mean of data. If it is missing or None (the default), the mean is automatically ca

statistics.pstdev()

statistics.pstdev(data, mu=None) Return the population standard deviation (the square root of the population variance). See pvariance() for arguments and other details. >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75]) 0.986893273527251

statistics.mode()

statistics.mode(data) Return the most common data point from discrete or nominal data. The mode (when it exists) is the most typical value, and is a robust measure of central location. If data is empty, or if there is not exactly one most common value, StatisticsError is raised. mode assumes discrete data, and returns a single value. This is the standard treatment of the mode as commonly taught in schools: >>> mode([1, 1, 2, 3, 3, 3, 3, 4]) 3 The mode is unique in that it is the on

statistics.median_low()

statistics.median_low(data) Return the low median of numeric data. If data is empty, StatisticsError is raised. The low median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the smaller of the two middle values is returned. >>> median_low([1, 3, 5]) 3 >>> median_low([1, 3, 5, 7]) 3 Use the low median when your data are discrete and you prefer the median to be an actual data point rather than interpo

statistics.median_high()

statistics.median_high(data) Return the high median of data. If data is empty, StatisticsError is raised. The high median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the larger of the two middle values is returned. >>> median_high([1, 3, 5]) 3 >>> median_high([1, 3, 5, 7]) 5 Use the high median when your data are discrete and you prefer the median to be an actual data point rather than interpolat

statistics.median_grouped()

statistics.median_grouped(data, interval=1) Return the median of grouped continuous data, calculated as the 50th percentile, using interpolation. If data is empty, StatisticsError is raised. >>> median_grouped([52, 52, 53, 54]) 52.5 In the following example, the data are rounded, so that each value represents the midpoint of data classes, e.g. 1 is the midpoint of the class 0.5-1.5, 2 is the midpoint of 1.5-2.5, 3 is the midpoint of 2.5-3.5, etc. With the data given, the middle val