earthkit.utils.array.namespace.UnknownPatchedNamespace

class earthkit.utils.array.namespace.UnknownPatchedNamespace(xp)[source]

Bases: object

__init__(xp)[source]

Methods

__init__(xp)

allclose(x, y, *[, rtol, atol, equal_nan])

deg2rad(x)

device(x)

dtype(x)

histogram2d(x, y, *[, bins])

Compute a 2D histogram.

histogramdd(x, *[, bins])

isclose(x, y, *[, rtol, atol, equal_nan])

percentile(a, q[, axis])

Compute percentiles by calling the quantile function.

polyval(x, c)

Evaluation of a polynomial using Horner's scheme.

quantile(a, q[, axis])

rad2deg(x)

shape(x)

Return the shape of an array.

size(x)

Return the size of an array.

to_device(x, device, **kwargs)

Attributes

xp

allclose(x, y, *, rtol=1e-05, atol=1e-08, equal_nan=False)[source]
deg2rad(x)[source]
device(x)[source]
dtype(x)[source]
histogram2d(x, y, *, bins=10)[source]

Compute a 2D histogram.

Parameters:
  • x (array-like) – An array containing the x coordinates of the points to be histogrammed.

  • y (array-like) – An array containing the y coordinates of the points to be histogrammed.

  • bins (int or list of int, optional) – The number of bins for the histogram in each dimension. If bins is an int, it is used for both dimensions.

histogramdd(x, *, bins=10)[source]
isclose(x, y, *, rtol=1e-05, atol=1e-08, equal_nan=False)[source]
percentile(a, q, axis=None)[source]

Compute percentiles by calling the quantile function.

polyval(x, c)[source]

Evaluation of a polynomial using Horner’s scheme.

If c is of length n + 1, this function returns the value

\[p(x) = c_0 + c_1 * x + ... + c_n * x^n\]
Parameters:
  • x (array-like) – The values(s) at which to evaluate the polynomial. Its elements must support addition and multiplication with with themselves and with the elements of c.

  • c (array-like) – Array of coefficients ordered so that the coefficients for terms of degree n are contained in c[n].

Returns:

values – The value(s) of the polynomial at the given point(s).

Return type:

array-like

Comments

Based on the numpy.polynomal.polynomial.polyval function.

quantile(a, q, axis=None)[source]
rad2deg(x)[source]
shape(x)[source]

Return the shape of an array.

size(x)[source]

Return the size of an array.

to_device(x, device, **kwargs)[source]
property xp