pdk.Math.Math ($Date: 2002/12/04 10:16:02 $)
index
pdk/Math/Math.py

Core pdk math routines.

FOG 10.2002

 
Functions
            
bins(data, n_classes, scale='linear', pretty=1)
bins data into a preset number of classes. Returns a 3-tuple (#positive bins, #negative bins, list of bin boundaries) derived from the data in data. Bin boundaries are spaced either evenly (scale == "linear") or logarithmically (scale == "log") across the span of the data. If pretty is set to one, bin boundaries are rounded to the next order of magnitude. If no negative/positive data are given, an empty tuple is returned. The list of bin boundaries begins with the most negative and ends with the most positive value.
enumerate_indices(shapeT, minIndices=None, maxIndices=None)

returns an array of shape (product(shapeT),len(shapeT)) containing the indices of an array of shape shapeT.

minIndices and maxIndices are optional sequences providing minimum/ maximum indices for each dimension.

Note that the indices traverse the dimensions given in shapeT "depth-first", i.e., in a 2d array of indices, column indices are repeated while row indices are increased steadily (in the manner a cathode ray tube monitor image is created...).

frequency_distribution(obs, iwidth=1, omin=None, omax=None, counts=0)
frequency distribution (= histogram) for an array. Calculates the values for a frequency distribution of an arbitrary array of observed values obs. Each frequency class has the width iwidth and includes the lower/excludes the upper value of its interval. omin and omax provide optional (global) lower and upper boundaries. If counts is set to 1, the raw counts are returned instead of the frequencies.
frexp10(x)
splits a number in a mantisse [0 .. 1] and an exponent, i.e. returns x plit into (m,e), with m in [0,1], e a power of 10, so that m * e = x.
isboolean(a)
test if a number is a Boolean value.
log_base(num, base=2.7182818284590451)
Purpose: generalized logarithm
lower(M)
returns the lower matrix of a square matrix (same shape as input).
lower_elements(M)
returns the lower elements of a square matrix as 1d array.
lower_indices(n)
returns a 1-d array of the indices of a lower triangular matrix. n specifies the size of the full (square) matrix.
matrix_fix_nonzero_axis(M, nonZeroRowA, axis=0)
matrix_fix_nonzero_columns(M, nonZeroColumnA)
matrix_fix_nonzero_rows = matrix_fix_nonzero_axis(M, nonZeroRowA, axis=0)
matrix_test_2d(M)
matrix_test_binary(M)
matrix_test_nonzero_axis(M, axis=0)
matrix_test_nonzero_columns(M)
matrix_test_nonzero_rows = matrix_test_nonzero_axis(M, axis=0)
matrix_test_square(M)
matrix_test_symmetric(M)
nonzero_nd(a)
n-dimensional version of the standard NumPy nonzero - returns the indices in a that are nonzero, regardless of its shape.
offdiagonal_elements(M)
returns the off-diagonal elements of a square matrix (same shape as input).
offdiagonal_indicator_matrix(n)
returns a square binary matrix with only the diagonal elements set to zero. n specifies the size of the square matrix.
put_nd(a, indexA, valueA)
n-dimensional version of the standard NumPy put.
take_nd(a, indexA)
n-dimensional version of the standard NumPy take.
upper(M)
returns the lower matrix of a square matrix (same shape as input).
upper_elements(M)
returns the upper elements of a square matrix as 1d array.
upper_indices(n)
returns a 1-d array of the indices of an upper triangular matrix. n specifies the size of the full (square) matrix.
 
Author
            
$Author: gathmann $