Package PyDSTool :: Package Toolbox :: Module data_analysis :: Class data_bins
[hide private]
[frames] | no frames]

Class data_bins

source code

object --+
         |
        data_bins

Class for data binning. Indexed by bin number 0 - (num_bins-1).

Initialization arguments:
        coordinate -- name of coordinate that occupies bins
        bin_ords   -- ordered sequence of n bin ordinates (integers or floats)
                      defining n-1 bins
        valuedict  -- optional dictionary containing initial values for
                      bins: keys = ordinate values,
                            values = coordinate values
        tolerance  -- for resolving bin edges with finite precision
                      arithmetic (defaults to 1e-12)

Instance Methods [hide private]
 
__init__(self, coordinate, bin_ords, valuedict=None, tolerance=1e-12)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
resolve_bin_index(self, ordinate)
Find bin number (index) associated with ordinate
source code
 
__call__(self, ordinate)
Return content of the bin that ordinate resolves to.
source code
 
__getitem__(self, bin_index) source code
 
__setitem__(self, bin_index, value)
Set value of a given bin number (index).
source code
 
increment(self, ordinate, inc=1)
Increment the bin corresponding to the ordinate argument.
source code
 
bin(self, values)
Increment bin contents according to values passed.
source code
 
clear(self)
Reset all bins to have zero contents.
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
str(x)
source code
 
to_pointset(self)
Convert to a pointset
source code
 
to_arrays(self)
Convert to two arrays of bin indices and values
source code
 
values(self) source code
 
keys(self) source code
 
mean(self)
Mean of binned data
source code
 
std(self)
Standard deviation of binned data
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, coordinate, bin_ords, valuedict=None, tolerance=1e-12)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

increment(self, ordinate, inc=1)

source code 

Increment the bin corresponding to the ordinate argument. Optional argument inc sets increment amount (default 1).

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

str(x)

Overrides: object.__repr__
(inherited documentation)