Author: | |
---|---|
Release: | $Id$ |
Date: | December 09, 2013 |
Tags: | Python |
Histograms can be calculated from a list/tuple/array of values. The histogram returned is then a list of tuples of the format [(bin1,value1), (bin2,value2), ...].
get a histogram using an SQL-statement. Intervals can be either supplied directly or are build from the data by providing the number of bins and optionally a minimum or maximum value.
If no number of bins are provided, the bin-size is 1.
This command uses the INTERVAL command from MYSQL, i.e. a bin value determines the upper boundary of a bin.
calculate a histogram based on a list or tuple of values.
calculate a histogram based on a list or tuple of values.
use scipy for calculation.
rescale bins in histogram.
add bins to histogram.
combine a list of histograms Each histogram is a sorted list of bins and counts. The counts can be tuples.
print a histogram.
A histogram can either be a list/tuple of values or a list/tuple of lists/tuples where the first value contains the bin and second contains the values (which can again be a list/tuple).
print a histogram.
A histogram can either be a list/tuple of values or a list/tuple of lists/tuples where the first value contains the bin and second contains the values (which can again be a list/tuple).
Parameters: | format – output format. 0 = print histogram in several lines, 1 = print histogram on single line |
---|
fill every empty value in histogram with previous value.
adds values of histogram h1 and h2 and returns a new histogram
smooth histogram by sliding window-method, where the window is wrapped around the borders. The sum of all values is entered at center of window.
print histogram ascii-style.
count categorized data. Returns a list of tuples with (count, token).
add successive counts in histogram. Bins are labelled by group average.
calculate cumulative distribution.
adds relative and cumulative percents to a histogram.
Return a list of (value, count) pairs, summarizing the input values. Sorted by increasing value, or if mode=1, by decreasing count. If bin_function is given, map it over values first. Ex: vals = [100, 110, 160, 200, 160, 110, 200, 200, 220] histogram(vals) ==> [(100, 1), (110, 2), (160, 2), (200, 3), (220, 1)] histogram(vals, 1) ==> [(200, 3), (160, 2), (110, 2), (100, 1), (220, 1)] histogram(vals, 1, lambda v: round(v, -2)) ==> [(200.0, 6), (100.0, 3)]
cumulate histogram in place.
histogram is list of (bin, value) or (bin, (values,) )
normalize histogram in place.
histogram is list of (bin, value) or (bin, (values,) )
fill a histogram from bins.
The values are given by an iterator so that the histogram can be built on the fly.
Description:
Count the number of times values from array a fall into numerical ranges defined by bins. Range x is given by bins[x] <= range_x < bins[x+1] where x =0,N and N is the length of the bins array. The last range is given by bins[N] <= range_N < infinity. Values less than bins[0] are not included in the histogram.
Returns: 1D array. Each value represents the occurences for a given bin (range) of values.
fill several histograms from several columns in a file.
The histograms are built on the fly.
Description:
Count the number of times values from array a fall into numerical ranges defined by bins. Range x is given by bins[x] <= range_x < bins[x+1] where x =0,N and N is the length of the bins array. The last range is given by bins[N] <= range_N < infinity. Values less than bins[0] are not included in the histogram.
Returns: a list of 1D arrays. Each value represents the occurences for a given bin (range) of values.
WARNING: missing value in columns are ignored