8.1 histogram -- 1-dimensional histograms

class histogram( long size | histogram h)
This type implements all methods on struct gsl_histogram.

alloc( long length)
allocate necessary space, returns None
set_ranges_uniform( float upper, float lower)
set the ranges to uniform distance, returns None
reset( )
sets all bin values to 0, returns None
increment( float x)
increments corresponding bin, returns None
accumulate( float x, float weight)
adds the weight to corresponding bin, returns None
max( )
returns upper range, as float
min( )
returns lower range, as float
bins( )
returns number of bins, as long
get( long n)
gets value of indexed bin, returns float
get_range( long n)
gets upper and lower range of indexed bin, returns (float,float)
find( float x)
finds index of corresponding bin, returns long
max_val( )
returns maximal bin value, as float
max_bin( )
returns bin index with maximal value, as long
min_val( )
returns minimal bin value, as float
min_bin( )
returns bin index with minimal value, as long
mean( )
returns mean of histogram, as float
sigma( )
returns std deviation of histogram, as float
sum( )
returns sum of bin values, as float
set_ranges( sequence ranges)
sets range according given sequence, returns None
shift( float offset)
shifts the contents of the bins by the given offset, returns None
scale( float scale)
multiplies the contents of the bins by the given scale, returns None
equal_bins_p( )
true if the all of the individual bin ranges are identical, returns int
add( histogram h)
adds the contents of the bins, returns None
sub( histogram h)
substracts the contents of the bins, returns None
mul( histogram h)
multiplicates the contents of the bins, returns None
div( histogram h)
divides the contents of the bins, returns None
clone( histogram h)
returns a new copy of this histogram, returns new histogram
copy( histogram h)
copies the given histogram to myself, returns None
read( file input)
reads histogram binary data from file, returns None
write( file output)
writes histogram binary data to file, returns None
scanf( file input)
reads histogram data from file using scanf, returns None
printf( file output)
writes histogram data to file using printf, returns None

Some mapping operations are supported, too:

Mapping syntax Effect
histogram[index] returns the value of the indexed bin
histogram[index]=value sets the value of the indexed bin
len(histogram) returns the length of the histogram

See Also:

For the special meaning and details please consult the GNU Scientific Library reference.