Skip to content

Latest commit

 

History

History
167 lines (72 loc) · 3.66 KB

File metadata and controls

167 lines (72 loc) · 3.66 KB

ulab.vector

Element-by-element functions

These functions can operate on numbers, 1-D iterables, 1-D arrays, or 2-D arrays by applying the function to every element in the array. This is typically much more efficient than expressing the same operation as a Python loop.

acos(a: _ArrayLike) -> ulab.array

Computes the inverse cosine function

acosh(a: _ArrayLike) -> ulab.array

Computes the inverse hyperbolic cosine function

asin(a: _ArrayLike) -> ulab.array

Computes the inverse sine function

asinh(a: _ArrayLike) -> ulab.array

Computes the inverse hyperbolic sine function

around(a: _ArrayLike, *, decimals: int = 0) -> ulab.array

Returns a new float array in which each element is rounded to decimals places.

atan(a: _ArrayLike) -> ulab.array

Computes the inverse tangent function; the return values are in the range [-pi/2,pi/2].

arctan2(ya: _ArrayLike, xa: _ArrayLike) -> ulab.array

Computes the inverse tangent function of y/x; the return values are in the range [-pi, pi].

atanh(a: _ArrayLike) -> ulab.array

Computes the inverse hyperbolic tangent function

ceil(a: _ArrayLike) -> ulab.array

Rounds numbers up to the next whole number

cos(a: _ArrayLike) -> ulab.array

Computes the cosine function

cosh(a: _ArrayLike) -> ulab.array

Computes the hyperbolic cosine function

degrees(a: _ArrayLike) -> ulab.array

Converts angles from radians to degrees

erf(a: _ArrayLike) -> ulab.array

Computes the error function, which has applications in statistics

erfc(a: _ArrayLike) -> ulab.array

Computes the complementary error function, which has applications in statistics

exp(a: _ArrayLike) -> ulab.array

Computes the exponent function.

expm1(a: _ArrayLike) -> ulab.array

Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the exp function.

floor(a: _ArrayLike) -> ulab.array

Rounds numbers up to the next whole number

gamma(a: _ArrayLike) -> ulab.array

Computes the gamma function

lgamma(a: _ArrayLike) -> ulab.array

Computes the natural log of the gamma function

log(a: _ArrayLike) -> ulab.array

Computes the natural log

log10(a: _ArrayLike) -> ulab.array

Computes the log base 10

log2(a: _ArrayLike) -> ulab.array

Computes the log base 2

radians(a: _ArrayLike) -> ulab.array

Converts angles from degrees to radians

sin(a: _ArrayLike) -> ulab.array

Computes the sine function

sinh(a: _ArrayLike) -> ulab.array

Computes the hyperbolic sine

sqrt(a: _ArrayLike) -> ulab.array

Computes the square root

tan(a: _ArrayLike) -> ulab.array

Computes the tangent

tanh(a: _ArrayLike) -> ulab.array

Computes the hyperbolic tangent

vectorize(f: Union[Callable[[int], float], Callable[[float], float]], *, otypes: Optional[_DType] = None) -> Callable[[_ArrayLike], ulab.array]

param callable f

The function to wrap

param otypes

List of array types that may be returned by the function. None is interpreted to mean the return value is float.

Wrap a Python function f so that it can be applied to arrays. The callable must return only values of the types specified by otypes, or the result is undefined.