gsl.Histogram

Module Contents

class gsl.Histogram.Histogram(bins, data=None, **kwds)

A wrapper over a gsl histogram

bins = 0
data
uniform(self, lower, upper)

Adjust the histogram bins to cover the range [lower, upper) uniformly. The values of the bins are reset to zero

ranges(self, points)

Use {points} to define the histogram bins. {points} is expected to be an iterable of size one greater than the size of the histogram itself; the extra element is used to specify the upper value of the last bin. The entries in {points} must be monotonically increasing

reset(self)

Reset the values of all the bins to zero

increment(self, x)

Increment by one the bin whose range contains {x}

accumulate(self, x, weight)

Add {weight} to the bin whose range contains {x}

fill(self, values)

Increment my frequency counts using the contents of the vector {values}

clone(self)

Allocate a new histogram and initialize it using my values

copy(self, other)

Make me an exact copy of {other}

values(self)

Return a vector that contains the values from each of my bins. This is equivalent to

v = gsl.vector.alloc(shape=self.bins) for i in range(self.bins):

v[i] = self[i]

return v

find(self, x)

Return the index of the bin that contains the value {x}

max(self)

Return my maximum upper range

min(self)

Return my minimum lower range

range(self, i)

Return a tuple [lower, upper) that describes the range of the {i}th bin

max_bin(self)

Return the index of the bin where maximum value is contained in the histogram

max_value(self)

Return the maximum value contained in the histogram

min_bin(self)

Return the index of the bin where minimum value is contained in the histogram

min_value(self)

Return the minimum value contained in the histogram

mean(self)

Return the mean of the histogrammed variable

sdev(self)

Return the standard deviation of the histogrammed variable

sum(self)

Return the sum of all bin values

__len__(self)
__iter__(self)
__getitem__(self, index)
__iadd__(self, other)

In-place addition with the elements of {other}

__isub__(self, other)

In-place subtraction with the elements of {other}

__imul__(self, other)

In-place multiplication with the elements of {other}

__itruediv__(self, other)

In-place addition with the elements of {other}