Home | Trees | Indices | Help |
---|
|
Utilities for NumPy arrays and matrices that contain numbers with uncertainties. This package contains: 1) utilities that help with the creation and manipulation of NumPy arrays and matrices of numbers with uncertainties; 2) generalizations of multiple NumPy functions so that they also work with arrays that contain numbers with uncertainties. - Arrays of numbers with uncertainties can be built as follows: arr = unumpy.uarray(([1, 2], [0.01, 0.002])) # (values, uncertainties) NumPy arrays of numbers with uncertainties can also be built directly through NumPy, thanks to NumPy's support of arrays of arbitrary objects: arr = numpy.array([uncertainties.ufloat((1, 0.1)),...]) - Matrices of numbers with uncertainties are best created in one of two ways: mat = unumpy.umatrix(([1, 2], [0.01, 0.002])) # (values, uncertainties) Matrices can also be built by converting arrays of numbers with uncertainties, through the unumpy.matrix class: mat = unumpy.matrix(arr) unumpy.matrix objects behave like numpy.matrix objects of numbers with uncertainties, but with better support for some operations (such as matrix inversion): # The inverse or pseudo-inverse of a unumpy.matrix can be calculated: print mat.I # Would not work with numpy.matrix([[ufloat(...),...]]).I - Nominal values and uncertainties of arrays can be directly accessed: print unumpy.nominal_values(arr) # [ 1. 2.] print unumpy.std_devs(mat) # [ 0.01 0.002] - This module defines uncertainty-aware mathematical functions that generalize those from uncertainties.umath so that they work on NumPy arrays of numbers with uncertainties instead of just scalars: print unumpy.cos(arr) # Array with the cosine of each element NumPy's function names are used, and not those of the math module (for instance, unumpy.arccos is defined, like in NumPy, and is not named acos like in the standard math module). The definitions of the mathematical quantities calculated by these functions are available in the documentation of uncertainties.umath. - The unumpy.ulinalg module contains more uncertainty-aware functions for arrays that contain numbers with uncertainties (see the documentation for this module). This module requires the NumPy package. (c) 2009-2013 by Eric O. LEBIGOT (EOL) <eric.lebigot@normalesup.org>. Please send feature requests, bug reports, or feedback to this address. This software is released under a dual license. (1) The BSD license. (2) Any other license, as long as it is obtained from the original author.
Author: Eric O. LEBIGOT (EOL) <eric.lebigot@normalesup.org>
|
|||
|
|
|||
matrix Class equivalent to numpy.matrix, but that behaves better when the matrix contains numbers with uncertainties. |
|
|||
|
|||
|
|||
|
|||
|
|
|||
__all__ = core.__all__
|
|||
__package__ =
|
|||
arccos = <numpy.lib.function_base.vectorize object at 0x10e669
|
|||
arccosh = <numpy.lib.function_base.vectorize object at 0x10e66
|
|||
arcsin = <numpy.lib.function_base.vectorize object at 0x10e669
|
|||
arctan = <numpy.lib.function_base.vectorize object at 0x10e669
|
|||
arctan2 = <numpy.lib.function_base.vectorize object at 0x10e66
|
|||
arctanh = <numpy.lib.function_base.vectorize object at 0x10e66
|
|||
asinh = <numpy.lib.function_base.vectorize object at 0x10e669d50>
|
|||
ceil = <numpy.lib.function_base.vectorize object at 0x10e669e50>
|
|||
copysign = <numpy.lib.function_base.vectorize object at 0x10e6
|
|||
cos = <numpy.lib.function_base.vectorize object at 0x10e669ed0>
|
|||
cosh = <numpy.lib.function_base.vectorize object at 0x10e669f10>
|
|||
degrees = <numpy.lib.function_base.vectorize object at 0x10e66
|
|||
erf = <numpy.lib.function_base.vectorize object at 0x10e669f90>
|
|||
erfc = <numpy.lib.function_base.vectorize object at 0x10e669fd0>
|
|||
exp = <numpy.lib.function_base.vectorize object at 0x10e67c050>
|
|||
expm1 = <numpy.lib.function_base.vectorize object at 0x10e67c090>
|
|||
fabs = <numpy.lib.function_base.vectorize object at 0x10e67c0d0>
|
|||
floor = <numpy.lib.function_base.vectorize object at 0x10e67c110>
|
|||
fmod = <numpy.lib.function_base.vectorize object at 0x10e67c150>
|
|||
gamma = <numpy.lib.function_base.vectorize object at 0x10e67c190>
|
|||
hypot = <numpy.lib.function_base.vectorize object at 0x10e67c1d0>
|
|||
isinf = <numpy.lib.function_base.vectorize object at 0x10e67c210>
|
|||
isnan = <numpy.lib.function_base.vectorize object at 0x10e67c250>
|
|||
ldexp = <numpy.lib.function_base.vectorize object at 0x10e67c5d0>
|
|||
lgamma = <numpy.lib.function_base.vectorize object at 0x10e67c
|
|||
log = <numpy.lib.function_base.vectorize object at 0x10e67c2d0>
|
|||
log10 = <numpy.lib.function_base.vectorize object at 0x10e67c310>
|
|||
log1p = <numpy.lib.function_base.vectorize object at 0x10e67c350>
|
|||
modf = <numpy.lib.function_base.vectorize object at 0x10e67c590>
|
|||
pow = <numpy.lib.function_base.vectorize object at 0x10e67c390>
|
|||
radians = <numpy.lib.function_base.vectorize object at 0x10e67
|
|||
sin = <numpy.lib.function_base.vectorize object at 0x10e67c410>
|
|||
sinh = <numpy.lib.function_base.vectorize object at 0x10e67c450>
|
|||
sqrt = <numpy.lib.function_base.vectorize object at 0x10e67c490>
|
|||
tan = <numpy.lib.function_base.vectorize object at 0x10e67c4d0>
|
|||
tanh = <numpy.lib.function_base.vectorize object at 0x10e67c510>
|
|||
trunc = <numpy.lib.function_base.vectorize object at 0x10e67c550>
|
|
Returns the nominal values of the numbers in NumPy array arr. Elements that are not uncertainties.AffineScalarFunc are passed through untouched (because a numpy.array can contain numbers with uncertainties and pure floats simultaneously). If arr is of type unumpy.matrix, the returned array is a numpy.matrix, because the resulting matrix does not contain numbers with uncertainties. |
Returns the standard deviations of the numbers in NumPy array arr. Elements that are not uncertainties.AffineScalarFunc are given a zero uncertainty ((because a numpy.array can contain numbers with uncertainties and pure floats simultaneously).. If arr is of type unumpy.matrix, the returned array is a numpy.matrix, because the resulting matrix does not contain numbers with uncertainties. |
Returns a NumPy array of numbers with uncertainties initialized with the given nominal values and standard deviations. values, std_devs -- valid arguments for numpy.array, with identical shapes (list of numbers, list of lists, numpy.ndarray, etc.). |
Constructs a matrix that contains numbers with uncertainties. The input data is the same as for uarray(...): a tuple with the nominal values, and the standard deviations. The returned matrix can be inverted, thanks to the fact that it is a unumpy.matrix object instead of a numpy.matrix one. |
|
__package__
|
arccos
|
arccosh
|
arcsin
|
arctan
|
arctan2
|
arctanh
|
copysign
|
degrees
|
lgamma
|
radians
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Nov 7 18:01:56 2016 | http://epydoc.sourceforge.net |