Cyforanumera
npm

API reference

NumPy name index

Every public NumPy 2.5.3 name that numera tracks, with its JavaScript equivalent in v1.0.2. 1045 are implemented and 9 are not yet. Names marked documented have a full reference entry with an example. For the others, open signature to see the TypeScript declaration, and follow the NumPy link for the semantics, which numera mirrors.

The JavaScript name is the NumPy name in camelCase, and Python keyword arguments become an options object. The compatibility page lists every documented difference from NumPy.

numpy.random.Generator# 44 / 45

NumPynumeraSummary
betamethodrng.beta documented
signature
rng.beta(a: number, b: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Beta distribution.
binomialmethodrng.binomial documented
signature
rng.binomial(n: number, p: number, size?: Size | null | undefined): number | NDArray
Draw samples from a binomial distribution.
bit_generatorattributerng.bit_generator documented
signature
rng.bit_generator: string
Gets the bit generator instance used by the generator
bytesmethodrng.bytes
signature
rng.bytes(length: number): Uint8Array<ArrayBufferLike>
Return random bytes.
chisquaremethodrng.chisquare documented
signature
rng.chisquare(df: number, size?: Size | null | undefined): number | NDArray
Draw samples from a chi-square distribution.
choicemethodrng.choice documented
signature
rng.choice(a: Population, size?: Size | { size?: Size | undefined; replace?: boolean | undefined; p?: unknown; axis?: number | undefined; shuffle?: boolean | undefined; } | null | undefined, replace?: boolean | undefined, p?: unknown, axis?: number | undefined, shuffle?: boolean | undefined): Out
Generates a random sample from a given array
dirichletmethodrng.dirichlet documented
signature
rng.dirichlet(alpha: readonly number[], size?: Size | null | undefined): NDArray
Draw samples from the Dirichlet distribution.
exponentialmethodrng.exponential documented
signature
rng.exponential(scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from an exponential distribution.
fmethodrng.f documented
signature
rng.f(dfnum: number, dfden: number, size?: Size | null | undefined): number | NDArray
Draw samples from an F distribution.
gammamethodrng.gamma documented
signature
rng.gamma(shape: number, scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a Gamma distribution.
geometricmethodrng.geometric
signature
rng.geometric(p: number, size?: Size | null | undefined): number | NDArray
Draw samples from the geometric distribution.
gumbelmethodrng.gumbel documented
signature
rng.gumbel(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a Gumbel distribution.
hypergeometricmethodrng.hypergeometric documented
signature
rng.hypergeometric(ngood: number, nbad: number, nsample: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Hypergeometric distribution.
integersmethodrng.integers documented
signature
rng.integers(low: number | bigint | { low: number | bigint; high?: number | bigint | null | undefined; size?: Size | undefined; dtype?: DTypeLike | undefined; endpoint?: boolean | undefined; }, high?: number | bigint | null | undefined, size?: Size | undefined, dt?: DTypeLike | undefined, endpoint?: boolean | undefined): Out
Return random integers from low (inclusive) to high (exclusive), or if endpoint=True, low (inclusive) to high (inclusive). Replaces RandomState.randint (with endpoint=False) and RandomState.random_integers (with endpoint=True)
laplacemethodrng.laplace documented
signature
rng.laplace(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from the Laplace or double exponential distribution with specified location (or mean) and scale (decay).
logisticmethodrng.logistic documented
signature
rng.logistic(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a logistic distribution.
lognormalmethodrng.lognormal documented
signature
rng.lognormal(mean?: number | undefined, sigma?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a log-normal distribution.
logseriesmethodrng.logseries documented
signature
rng.logseries(p: number, size?: Size | null | undefined): number | NDArray
Draw samples from a logarithmic series distribution.
multinomialmethodrng.multinomial documented
signature
rng.multinomial(n: number, pvals: readonly number[], size?: Size | null | undefined): NDArray
Draw samples from a multinomial distribution.
multivariate_hypergeometricmethodrng.multivariateHypergeometric documented
signature
rng.multivariateHypergeometric(colors: readonly number[], nsample: number, size?: Size | null | undefined, method?: "count" | "marginals" | undefined): NDArray
Generate variates from a multivariate hypergeometric distribution.
multivariate_normalmethodnot implementedDraw random samples from a multivariate normal distribution.
negative_binomialmethodrng.negativeBinomial documented
signature
rng.negativeBinomial(n: number, p: number, size?: Size | null | undefined): number | NDArray
Draw samples from a negative binomial distribution.
noncentral_chisquaremethodrng.noncentralChisquare documented
signature
rng.noncentralChisquare(df: number, nonc: number, size?: Size | null | undefined): number | NDArray
Draw samples from a noncentral chi-square distribution.
noncentral_fmethodrng.noncentralF documented
signature
rng.noncentralF(dfnum: number, dfden: number, nonc: number, size?: Size | null | undefined): number | NDArray
Draw samples from the noncentral F distribution.
normalmethodrng.normal documented
signature
rng.normal(loc?: number | { loc?: number | undefined; scale?: number | undefined; size?: Size | undefined; } | undefined, scale?: number | undefined, size?: Size | undefined): Out
Draw random samples from a normal (Gaussian) distribution.
paretomethodrng.pareto documented
signature
rng.pareto(a: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Pareto II (AKA Lomax) distribution with specified shape.
permutationmethodrng.permutation documented
signature
rng.permutation(x: NDArray | NestedArray, axis?: number | undefined): NDArray
Randomly permute a sequence, or return a permuted range.
permutedmethodrng.permuted documented
signature
rng.permuted(x: NDArray, axis?: number | undefined): NDArray
Randomly permute x along axis axis.
poissonmethodrng.poisson documented
signature
rng.poisson(lam?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a Poisson distribution.
powermethodrng.power documented
signature
rng.power(a: number, size?: Size | null | undefined): number | NDArray
Draws samples in [0, 1] from a power distribution with positive exponent a - 1.
randommethodrng.random
signature
rng.random(size?: Size | { size?: Size | undefined; dtype?: DTypeLike | undefined; } | undefined, dt?: DTypeLike | undefined): Out
Return random floats in the half-open interval [0.0, 1.0).
rayleighmethodrng.rayleigh documented
signature
rng.rayleigh(scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a Rayleigh distribution.
shufflemethodrng.shuffle documented
signature
rng.shuffle(x: NDArray, axis?: number | undefined): void
Modify an array or sequence in-place by shuffling its contents.
spawnmethodrng.spawn documented
signature
rng.spawn(n: number): Generator[]
Create new independent child generators.
standard_cauchymethodrng.standardCauchy documented
signature
rng.standardCauchy(size?: Size | null | undefined): number | NDArray
Draw samples from a standard Cauchy distribution with mode = 0.
standard_exponentialmethodrng.standardExponential documented
signature
rng.standardExponential(size?: Size | null | undefined): number | NDArray
Draw samples from the standard exponential distribution.
standard_gammamethodrng.standardGamma documented
signature
rng.standardGamma(shape: number, size?: Size | null | undefined): number | NDArray
Draw samples from a standard Gamma distribution.
standard_normalmethodrng.standardNormal documented
signature
rng.standardNormal(size?: Size | { size?: Size | undefined; dtype?: DTypeLike | undefined; } | undefined, dt?: DTypeLike | undefined): Out
Draw samples from a standard Normal distribution (mean=0, stdev=1).
standard_tmethodrng.standardT documented
signature
rng.standardT(df: number, size?: Size | null | undefined): number | NDArray
Draw samples from a standard Student's t distribution with df degrees of freedom.
triangularmethodrng.triangular documented
signature
rng.triangular(left: number, mode: number, right: number, size?: Size | null | undefined): number | NDArray
Draw samples from the triangular distribution over the interval [left, right].
uniformmethodrng.uniform documented
signature
rng.uniform(low?: number | { low?: number | undefined; high?: number | undefined; size?: Size | undefined; } | undefined, high?: number | undefined, size?: Size | undefined): Out
Draw samples from a uniform distribution.
vonmisesmethodrng.vonmises documented
signature
rng.vonmises(mu: number, kappa: number, size?: Size | null | undefined): number | NDArray
Draw samples from a von Mises distribution.
waldmethodrng.wald documented
signature
rng.wald(mean: number, scale: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Wald, or inverse Gaussian, distribution.
weibullmethodrng.weibull documented
signature
rng.weibull(a: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Weibull distribution.
zipfmethodrng.zipf documented
signature
rng.zipf(a: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Zipf distribution.

numpy.random.RandomState# 47 / 48

NumPynumeraSummary
betamethodnp.random.RandomState#beta
signature
rs.beta(a: number, b: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Beta distribution.
binomialmethodnp.random.RandomState#binomial
signature
rs.binomial(n: number, p: number, size?: Size | null | undefined): number | NDArray
Draw samples from a binomial distribution.
bytesmethodnp.random.RandomState#bytes
signature
rs.bytes(length: number): Uint8Array<ArrayBufferLike>
Return random bytes.
chisquaremethodnp.random.RandomState#chisquare
signature
rs.chisquare(df: number, size?: Size | null | undefined): number | NDArray
Draw samples from a chi-square distribution.
choicemethodnp.random.RandomState#choice
signature
rs.choice(a: Population, size?: Size | { size?: Size | undefined; replace?: boolean | undefined; p?: unknown; } | null | undefined, replace?: boolean | undefined, p?: unknown): Out
Generates a random sample from a given 1-D array
dirichletmethodnp.random.RandomState#dirichlet
signature
rs.dirichlet(alpha: readonly number[], size?: Size | null | undefined): NDArray
Draw samples from the Dirichlet distribution.
exponentialmethodnp.random.RandomState#exponential
signature
rs.exponential(scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from an exponential distribution.
fmethodnp.random.RandomState#f
signature
rs.f(dfnum: number, dfden: number, size?: Size | null | undefined): number | NDArray
Draw samples from an F distribution.
gammamethodnp.random.RandomState#gamma
signature
rs.gamma(shape: number, scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a Gamma distribution.
geometricmethodnp.random.RandomState#geometric
signature
rs.geometric(p: number, size?: Size | null | undefined): number | NDArray
Draw samples from the geometric distribution.
get_statemethodnp.random.RandomState#getState
signature
rs.getState(): bigint[]
Return a tuple representing the internal state of the generator.
gumbelmethodnp.random.RandomState#gumbel
signature
rs.gumbel(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a Gumbel distribution.
hypergeometricmethodnp.random.RandomState#hypergeometric
signature
rs.hypergeometric(ngood: number, nbad: number, nsample: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Hypergeometric distribution.
laplacemethodnp.random.RandomState#laplace
signature
rs.laplace(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from the Laplace or double exponential distribution with specified location (or mean) and scale (decay).
logisticmethodnp.random.RandomState#logistic
signature
rs.logistic(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a logistic distribution.
lognormalmethodnp.random.RandomState#lognormal
signature
rs.lognormal(mean?: number | undefined, sigma?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a log-normal distribution.
logseriesmethodnp.random.RandomState#logseries
signature
rs.logseries(p: number, size?: Size | null | undefined): number | NDArray
Draw samples from a logarithmic series distribution.
multinomialmethodnp.random.RandomState#multinomial
signature
rs.multinomial(n: number, pvals: readonly number[], size?: Size | null | undefined): NDArray
Draw samples from a multinomial distribution.
multivariate_normalmethodnot implementedDraw random samples from a multivariate normal distribution.
negative_binomialmethodnp.random.RandomState#negativeBinomial
signature
rs.negativeBinomial(n: number, p: number, size?: Size | null | undefined): number | NDArray
Draw samples from a negative binomial distribution.
noncentral_chisquaremethodnp.random.RandomState#noncentralChisquare
signature
rs.noncentralChisquare(df: number, nonc: number, size?: Size | null | undefined): number | NDArray
Draw samples from a noncentral chi-square distribution.
noncentral_fmethodnp.random.RandomState#noncentralF
signature
rs.noncentralF(dfnum: number, dfden: number, nonc: number, size?: Size | null | undefined): number | NDArray
Draw samples from the noncentral F distribution.
normalmethodnp.random.RandomState#normal
signature
rs.normal(loc?: number | { loc?: number | undefined; scale?: number | undefined; size?: Size | undefined; } | undefined, scale?: number | undefined, size?: Size | undefined): Out
Draw random samples from a normal (Gaussian) distribution.
paretomethodnp.random.RandomState#pareto
signature
rs.pareto(a: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Pareto II or Lomax distribution with specified shape.
permutationmethodnp.random.RandomState#permutation
signature
rs.permutation(x: NDArray | NestedArray): NDArray
Randomly permute a sequence, or return a permuted range.
poissonmethodnp.random.RandomState#poisson
signature
rs.poisson(lam?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a Poisson distribution.
powermethodnp.random.RandomState#power
signature
rs.power(a: number, size?: Size | null | undefined): number | NDArray
Draws samples in [0, 1] from a power distribution with positive exponent a - 1.
randmethodnp.random.RandomState#rand
signature
rs.rand(...dims: number[]): Out
Random values in a given shape.
randintmethodnp.random.RandomState#randint
signature
rs.randint(low: number | bigint | { low: number | bigint; high?: number | bigint | null | undefined; size?: Size | undefined; dtype?: DTypeLike | undefined; }, high?: number | bigint | null | undefined, size?: Size | undefined, dt?: DTypeLike | undefined): Out
Return random integers from low (inclusive) to high (exclusive).
randnmethodnp.random.RandomState#randn
signature
rs.randn(...dims: number[]): Out
Return a sample (or samples) from the "standard normal" distribution.
randommethodnp.random.RandomState#random
signature
rs.random(size?: Size | null | undefined): Out
Return random floats in the half-open interval [0.0, 1.0). Alias for random_sample to ease forward-porting to the new random API.
random_integersmethodnp.random.RandomState#random_integers
signature
rs.random_integers(low: number, high?: number | null | undefined, size?: Size | null | undefined): number | NDArray
Random integers of type numpy.int_ between low and high, inclusive.
random_samplemethodnp.random.RandomState#randomSample
signature
rs.randomSample(size?: Size | null | undefined): Out
Return random floats in the half-open interval [0.0, 1.0).
rayleighmethodnp.random.RandomState#rayleigh
signature
rs.rayleigh(scale?: number | undefined, size?: Size | null | undefined): number | NDArray
Draw samples from a Rayleigh distribution.
seedmethodnp.random.RandomState#seed
signature
rs.seed(seed?: Seed | null | undefined): void
Reseed a legacy MT19937 BitGenerator
set_statemethodnp.random.RandomState#setState
signature
rs.setState(words: bigint[]): void
Set the internal state of the generator from a tuple.
shufflemethodnp.random.RandomState#shuffle
signature
rs.shuffle(x: NDArray): void
Modify a sequence in-place by shuffling its contents.
standard_cauchymethodnp.random.RandomState#standardCauchy
signature
rs.standardCauchy(size?: Size | null | undefined): number | NDArray
Draw samples from a standard Cauchy distribution with mode = 0.
standard_exponentialmethodnp.random.RandomState#standardExponential
signature
rs.standardExponential(size?: Size | null | undefined): number | NDArray
Draw samples from the standard exponential distribution.
standard_gammamethodnp.random.RandomState#standardGamma
signature
rs.standardGamma(shape: number, size?: Size | null | undefined): number | NDArray
Draw samples from a standard Gamma distribution.
standard_normalmethodnp.random.RandomState#standardNormal
signature
rs.standardNormal(size?: Size | null | undefined): Out
Draw samples from a standard Normal distribution (mean=0, stdev=1).
standard_tmethodnp.random.RandomState#standardT
signature
rs.standardT(df: number, size?: Size | null | undefined): number | NDArray
Draw samples from a standard Student's t distribution with df degrees of freedom.
triangularmethodnp.random.RandomState#triangular
signature
rs.triangular(left: number, mode: number, right: number, size?: Size | null | undefined): number | NDArray
Draw samples from the triangular distribution over the interval [left, right].
uniformmethodnp.random.RandomState#uniform
signature
rs.uniform(low?: number | { low?: number | undefined; high?: number | undefined; size?: Size | undefined; } | undefined, high?: number | undefined, size?: Size | undefined): Out
Draw samples from a uniform distribution.
vonmisesmethodnp.random.RandomState#vonmises
signature
rs.vonmises(mu: number, kappa: number, size?: Size | null | undefined): number | NDArray
Draw samples from a von Mises distribution.
waldmethodnp.random.RandomState#wald
signature
rs.wald(mean: number, scale: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Wald, or inverse Gaussian, distribution.
weibullmethodnp.random.RandomState#weibull
signature
rs.weibull(a: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Weibull distribution.
zipfmethodnp.random.RandomState#zipf
signature
rs.zipf(a: number, size?: Size | null | undefined): number | NDArray
Draw samples from a Zipf distribution.

numpy.char# 52 / 52

NumPynumeraSummary
addufuncnp.char.add
signature
np.char.add(a: StringLike, b: StringLike): StringArray
Add arguments element-wise.
arrayfunctionnp.char.array documented
signature
np.char.array(data: StringLike, dtype?: StringDType | undefined): StringArray
Create a ~numpy.char.chararray.
asarrayfunctionnp.char.asarray
signature
np.char.asarray(data: StringLike, dtype?: StringDType | undefined): StringArray
Convert the input to a ~numpy.char.chararray, copying the data only if necessary.
capitalizefunctionnp.char.capitalize
signature
np.char.capitalize(a: StringLike): StringArray
Return a copy of a with only the first character of each element capitalized.
centerfunctionnp.char.center
signature
np.char.center(a: StringLike, width: number, fillchar?: string | undefined): StringArray
Return a copy of a with its elements centered in a string of length width.
countfunctionnp.char.count
signature
np.char.count(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Returns an array with the number of non-overlapping occurrences of substring sub in the range [start, end).
decodefunctionnp.char.decode
signature
np.char.decode(a: StringLike, encoding?: string | undefined, _errors?: string | undefined): StringArray
Calls :meth:bytes.decode element-wise.
encodefunctionnp.char.encode
signature
np.char.encode(a: StringLike, encoding?: string | undefined, _errors?: string | undefined): StringArray
Calls :meth:str.encode element-wise.
endswithfunctionnp.char.endswith
signature
np.char.endswith(a: StringLike, suffix: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Returns a boolean array which is True where the string element in a ends with suffix, otherwise False.
equalfunctionnp.char.equal
signature
np.char.equal(a: StringLike, b: StringLike): NDArray
Return (x1 == x2) element-wise.
expandtabsfunctionnp.char.expandtabs
signature
np.char.expandtabs(a: StringLike, tabsize?: number | undefined): StringArray
Return a copy of each string element where all tab characters are replaced by one or more spaces.
findfunctionnp.char.find
signature
np.char.find(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
For each element, return the lowest index in the string where substring sub is found, such that sub is contained in the range [start, end).
greaterfunctionnp.char.greater
signature
np.char.greater(a: StringLike, b: StringLike): NDArray
Return (x1 > x2) element-wise.
greater_equalfunctionnp.char.greater_equal
signature
np.char.greater_equal(a: StringLike, b: StringLike): NDArray
Return (x1 >= x2) element-wise.
indexfunctionnp.char.index
signature
np.char.index(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Like find, but raises :exc:ValueError when the substring is not found.
isalnumufuncnp.char.isalnum
signature
np.char.isalnum(a: StringLike): NDArray
Returns true for each element if all characters in the string are alphanumeric and there is at least one character, false otherwise.
isalphaufuncnp.char.isalpha
signature
np.char.isalpha(a: StringLike): NDArray
Returns true for each element if all characters in the data interpreted as a string are alphabetic and there is at least one character, false otherwise.
isdecimalufuncnp.char.isdecimal
signature
np.char.isdecimal(a: StringLike): NDArray
For each element, return True if there are only decimal characters in the element.
isdigitufuncnp.char.isdigit
signature
np.char.isdigit(a: StringLike): NDArray
Returns true for each element if all characters in the string are digits and there is at least one character, false otherwise.
islowerufuncnp.char.islower
signature
np.char.islower(a: StringLike): NDArray
Returns true for each element if all cased characters in the string are lowercase and there is at least one cased character, false otherwise.
isnumericufuncnp.char.isnumeric
signature
np.char.isnumeric(a: StringLike): NDArray
For each element, return True if there are only numeric characters in the element.
isspaceufuncnp.char.isspace
signature
np.char.isspace(a: StringLike): NDArray
Returns true for each element if there are only whitespace characters in the string and there is at least one character, false otherwise.
istitleufuncnp.char.istitle
signature
np.char.istitle(a: StringLike): NDArray
Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise.
isupperufuncnp.char.isupper
signature
np.char.isupper(a: StringLike): NDArray
Return true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise.
joinfunctionnp.char.join
signature
np.char.join(sep: StringLike, seq: StringLike): StringArray
Return a string which is the concatenation of the strings in the sequence seq.
lessfunctionnp.char.less
signature
np.char.less(a: StringLike, b: StringLike): NDArray
Return (x1 < x2) element-wise.
less_equalfunctionnp.char.less_equal
signature
np.char.less_equal(a: StringLike, b: StringLike): NDArray
Return (x1 <= x2) element-wise.
ljustfunctionnp.char.ljust
signature
np.char.ljust(a: StringLike, width: number, fillchar?: string | undefined): StringArray
Return an array with the elements of a left-justified in a string of length width.
lowerfunctionnp.char.lower
signature
np.char.lower(a: StringLike): StringArray
Return an array with the elements converted to lowercase.
lstripfunctionnp.char.lstrip
signature
np.char.lstrip(a: StringLike, chars?: string | null | undefined): StringArray
For each element in a, return a copy with the leading characters removed.
modfunctionnp.char.mod
signature
np.char.mod(a: StringLike, values: unknown): StringArray
Return (a % i), that is pre-Python 2.6 string formatting (interpolation), element-wise for a pair of array_likes of str or unicode.
multiplyfunctionnp.char.multiply
signature
np.char.multiply(a: StringLike, i: number | NDArray): StringArray
Return (a * i), that is string multiple concatenation, element-wise.
not_equalfunctionnp.char.not_equal
signature
np.char.not_equal(a: StringLike, b: StringLike): NDArray
Return (x1 != x2) element-wise.
partitionfunctionnp.char.partition
signature
np.char.partition(a: StringLike, sep: StringLike): StringArray[]
Partition each element in a around sep.
replacefunctionnp.char.replace
signature
np.char.replace(a: StringLike, old_: StringLike, new_: StringLike, count_?: number | undefined): StringArray
For each element in a, return a copy of the string with occurrences of substring old replaced by new.
rfindfunctionnp.char.rfind
signature
np.char.rfind(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
For each element, return the highest index in the string where substring sub is found, such that sub is contained in the range [start, end).
rindexfunctionnp.char.rindex
signature
np.char.rindex(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Like rfind, but raises :exc:ValueError when the substring sub is not found.
rjustfunctionnp.char.rjust
signature
np.char.rjust(a: StringLike, width: number, fillchar?: string | undefined): StringArray
Return an array with the elements of a right-justified in a string of length width.
rpartitionfunctionnp.char.rpartition
signature
np.char.rpartition(a: StringLike, sep: StringLike): StringArray[]
Partition (split) each element around the right-most separator.
rsplitfunctionnp.char.rsplit
signature
np.char.rsplit(a: StringLike, sep?: string | null | undefined, maxsplit?: number | undefined): StringArray[]
For each element in a, return a list of the words in the string, using sep as the delimiter string.
rstripfunctionnp.char.rstrip
signature
np.char.rstrip(a: StringLike, chars?: string | null | undefined): StringArray
For each element in a, return a copy with the trailing characters removed.
slicefunctionnp.char.slice
signature
np.char.slice(a: StringLike, start?: number | undefined, stop?: number | undefined, step?: number | undefined): StringArray
Slice the strings in a by slices specified by start, stop, step. Like in the regular Python slice object, if only start is specified then it is interpreted as the stop.
splitfunctionnp.char.split
signature
np.char.split(a: StringLike, sep?: string | null | undefined, maxsplit?: number | undefined): StringArray[]
For each element in a, return a list of the words in the string, using sep as the delimiter string.
splitlinesfunctionnp.char.splitlines
signature
np.char.splitlines(a: StringLike, keepends?: boolean | undefined): StringArray[]
For each element in a, return a list of the lines in the element, breaking at line boundaries.
startswithfunctionnp.char.startswith
signature
np.char.startswith(a: StringLike, prefix: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Returns a boolean array which is True where the string element in a starts with prefix, otherwise False.
str_lenufuncnp.char.str_len
signature
np.char.str_len(a: StringLike): NDArray
Returns the length of each element. For byte strings, this is the number of bytes, while, for Unicode strings, it is the number of Unicode code points.
stripfunctionnp.char.strip
signature
np.char.strip(a: StringLike, chars?: string | null | undefined): StringArray
For each element in a, return a copy with the leading and trailing characters removed.
swapcasefunctionnp.char.swapcase
signature
np.char.swapcase(a: StringLike): StringArray
Return element-wise a copy of the string with uppercase characters converted to lowercase and vice versa.
titlefunctionnp.char.title
signature
np.char.title(a: StringLike): StringArray
Return element-wise title cased version of string or unicode.
translatefunctionnp.char.translate
signature
np.char.translate(a: StringLike, table: Map<string, string | null>): StringArray
For each element in a, return a copy of the string where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table.
upperfunctionnp.char.upper
signature
np.char.upper(a: StringLike): StringArray
Return an array with the elements converted to uppercase.
zfillfunctionnp.char.zfill
signature
np.char.zfill(a: StringLike, width: number): StringArray
Return the numeric string left-filled with zeros. A leading sign prefix (+/-) is handled by inserting the padding after the sign character rather than before.

numpy.emath# 9 / 9

NumPynumeraSummary
arccosfunctionnp.emath.arccos documented
signature
np.emath.arccos(x: ArrayLike): NDArray
Compute the inverse cosine of x.
arcsinfunctionnp.emath.arcsin documented
signature
np.emath.arcsin(x: ArrayLike): NDArray
Compute the inverse sine of x.
arctanhfunctionnp.emath.arctanh documented
signature
np.emath.arctanh(x: ArrayLike): NDArray
Compute the inverse hyperbolic tangent of x.
logfunctionnp.emath.log documented
signature
np.emath.log(x: ArrayLike): NDArray
Compute the natural logarithm of x.
log10functionnp.emath.log10 documented
signature
np.emath.log10(x: ArrayLike): NDArray
Compute the logarithm base 10 of x.
log2functionnp.emath.log2 documented
signature
np.emath.log2(x: ArrayLike): NDArray
Compute the logarithm base 2 of x.
lognfunctionnp.emath.logn documented
signature
np.emath.logn(n: ArrayLike, x: ArrayLike): NDArray
Take log base n of x.
powerfunctionnp.emath.power documented
signature
np.emath.power(x: ArrayLike, p: ArrayLike): NDArray
Return x to the power p, (x**p).
sqrtfunctionnp.emath.sqrt documented
signature
np.emath.sqrt(x: ArrayLike): NDArray
Compute the square root of x.

numpy.fft# 18 / 18

NumPynumeraSummary
fftfunctionnp.fft.fft documented
signature
np.fft.fft(a: ArrayLike, n?: number | FftOptions | null | undefined, axis?: number | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the one-dimensional discrete Fourier Transform.
fft2functionnp.fft.fft2
signature
np.fft.fft2(a: ArrayLike, s?: number[] | FftNOptions | null | undefined, axes?: number[] | null | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the 2-dimensional discrete Fourier Transform.
fftfreqfunctionnp.fft.fftfreq documented
signature
np.fft.fftfreq(n: number, d?: number | undefined): NDArray
Return the Discrete Fourier Transform sample frequencies.
fftnfunctionnp.fft.fftn documented
signature
np.fft.fftn(a: ArrayLike, s?: number[] | FftNOptions | null | undefined, axes?: number[] | null | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the N-dimensional discrete Fourier Transform.
fftshiftfunctionnp.fft.fftshift documented
signature
np.fft.fftshift(x: ArrayLike, axes?: number | number[] | null | undefined): NDArray
Shift the zero-frequency component to the center of the spectrum.
hfftfunctionnp.fft.hfft documented
signature
np.fft.hfft(a: ArrayLike, n?: number | FftOptions | null | undefined, axis?: number | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the FFT of a signal that has Hermitian symmetry, i.e., a real spectrum.
ifftfunctionnp.fft.ifft documented
signature
np.fft.ifft(a: ArrayLike, n?: number | FftOptions | null | undefined, axis?: number | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the one-dimensional inverse discrete Fourier Transform.
ifft2functionnp.fft.ifft2
signature
np.fft.ifft2(a: ArrayLike, s?: number[] | FftNOptions | null | undefined, axes?: number[] | null | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the 2-dimensional inverse discrete Fourier Transform.
ifftnfunctionnp.fft.ifftn
signature
np.fft.ifftn(a: ArrayLike, s?: number[] | FftNOptions | null | undefined, axes?: number[] | null | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the N-dimensional inverse discrete Fourier Transform.
ifftshiftfunctionnp.fft.ifftshift documented
signature
np.fft.ifftshift(x: ArrayLike, axes?: number | number[] | null | undefined): NDArray
The inverse of fftshift. Although identical for even-length x, the functions differ by one sample for odd-length x.
ihfftfunctionnp.fft.ihfft documented
signature
np.fft.ihfft(a: ArrayLike, n?: number | FftOptions | null | undefined, axis?: number | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the inverse FFT of a signal that has Hermitian symmetry.
irfftfunctionnp.fft.irfft documented
signature
np.fft.irfft(a: ArrayLike, n?: number | FftOptions | null | undefined, axis?: number | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Computes the inverse of rfft.
irfft2functionnp.fft.irfft2
signature
np.fft.irfft2(a: ArrayLike, s?: number[] | FftNOptions | null | undefined, axes?: number[] | null | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Computes the inverse of rfft2.
irfftnfunctionnp.fft.irfftn
signature
np.fft.irfftn(a: ArrayLike, s?: number[] | FftNOptions | null | undefined, axes?: number[] | null | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Computes the inverse of rfftn.
rfftfunctionnp.fft.rfft documented
signature
np.fft.rfft(a: ArrayLike, n?: number | FftOptions | null | undefined, axis?: number | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the one-dimensional discrete Fourier Transform for real input.
rfft2functionnp.fft.rfft2
signature
np.fft.rfft2(a: ArrayLike, s?: number[] | FftNOptions | null | undefined, axes?: number[] | null | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the 2-dimensional FFT of a real array.
rfftfreqfunctionnp.fft.rfftfreq documented
signature
np.fft.rfftfreq(n: number, d?: number | undefined): NDArray
Return the Discrete Fourier Transform sample frequencies (for usage with rfft, irfft).
rfftnfunctionnp.fft.rfftn documented
signature
np.fft.rfftn(a: ArrayLike, s?: number[] | FftNOptions | null | undefined, axes?: number[] | null | undefined, norm?: FftNorm | null | undefined, out?: NDArray | null | undefined): NDArray
Compute the N-dimensional discrete Fourier Transform for real input.

numpy.linalg# 32 / 32

NumPynumeraSummary
choleskyfunctionnp.linalg.cholesky documented
signature
np.linalg.cholesky(a: ArrayLike, opts?: CholeskyOptions | undefined): NDArray
Cholesky decomposition.
condfunctionnp.linalg.cond documented
signature
np.linalg.cond(x: ArrayLike, p?: NormOrder | undefined): NDArray
Compute the condition number of a matrix.
crossfunctionnp.linalg.cross documented
signature
np.linalg.cross(x1: ArrayLike, x2: ArrayLike, opts?: { axis?: number | undefined; } | undefined): NDArray
Returns the cross product of 3-element vectors.
detfunctionnp.linalg.det documented
signature
np.linalg.det(a: ArrayLike): NDArray
Compute the determinant of an array.
diagonalfunctionnp.linalg.diagonal documented
signature
np.linalg.diagonal(x: ArrayLike, opts?: { offset?: number | undefined; } | undefined): NDArray
Returns specified diagonals of a matrix (or a stack of matrices) x.
eigfunctionnp.linalg.eig documented
signature
np.linalg.eig(a: ArrayLike): EigResult
Compute the eigenvalues and right eigenvectors of a square array.
eighfunctionnp.linalg.eigh documented
signature
np.linalg.eigh(a: ArrayLike): EigResult
Return the eigenvalues and eigenvectors of a complex Hermitian (conjugate symmetric) or a real symmetric matrix.
eigvalsfunctionnp.linalg.eigvals documented
signature
np.linalg.eigvals(a: ArrayLike): NDArray
Compute the eigenvalues of a general matrix.
eigvalshfunctionnp.linalg.eigvalsh documented
signature
np.linalg.eigvalsh(a: ArrayLike): NDArray
Compute the eigenvalues of a complex Hermitian or real symmetric matrix.
invfunctionnp.linalg.inv documented
signature
np.linalg.inv(a: ArrayLike): NDArray
Compute the inverse of a matrix.
LinAlgErrorclassnp.linalg.LinAlgError
signature
new np.linalg.LinAlgError(message: string, code?: string | undefined)
Generic Python-exception-derived object raised by linalg functions.
lstsqfunctionnp.linalg.lstsq documented
signature
np.linalg.lstsq(a: ArrayLike, b: ArrayLike, rcond?: number | null | undefined): LstsqResult
Return the least-squares solution to a linear matrix equation.
matmulfunctionnp.linalg.matmul
signature
np.linalg.matmul(a: ArrayLike, b: ArrayLike): NDArray
Computes the matrix product.
matrix_normfunctionnp.linalg.matrixNorm documented
signature
np.linalg.matrixNorm(x: ArrayLike, opts?: MatrixNormOptions | undefined): NDArray
Computes the matrix norm of a matrix (or a stack of matrices) x.
matrix_powerfunctionnp.linalg.matrixPower documented
signature
np.linalg.matrixPower(a: ArrayLike, n: number): NDArray
Raise a square matrix to the (integer) power n.
matrix_rankfunctionnp.linalg.matrixRank documented
signature
np.linalg.matrixRank(A: ArrayLike, opts?: MatrixRankOptions | undefined): NDArray
Return matrix rank of array using SVD method
matrix_transposefunctionnp.linalg.matrixTranspose documented
signature
np.linalg.matrixTranspose(x: ArrayLike): NDArray
Transposes a matrix (or a stack of matrices) x.
multi_dotfunctionnp.linalg.multiDot documented
signature
np.linalg.multiDot(arrays: readonly ArrayLike[]): NDArray
Compute the dot product of two or more arrays in a single function call, while automatically selecting the fastest evaluation order.
normfunctionnp.linalg.norm documented
signature
np.linalg.norm(a: ArrayLike, opts?: NormOptions | undefined): NDArray
Matrix or vector norm.
outerfunctionnp.linalg.outer documented
signature
np.linalg.outer(x1: ArrayLike, x2: ArrayLike): NDArray
Compute the outer product of two vectors.
pinvfunctionnp.linalg.pinv documented
signature
np.linalg.pinv(a: ArrayLike, opts?: PinvOptions | undefined): NDArray
Compute the (Moore-Penrose) pseudo-inverse of a matrix.
qrfunctionnp.linalg.qr documented
signature
np.linalg.qr(a: ArrayLike, mode?: QrMode | undefined): QrResult
Compute the qr factorization of a matrix.
slogdetfunctionnp.linalg.slogdet documented
signature
np.linalg.slogdet(a: ArrayLike): SlogdetResult
Compute the sign and (natural) logarithm of the determinant of an array.
solvefunctionnp.linalg.solve documented
signature
np.linalg.solve(a: ArrayLike, b: ArrayLike): NDArray
Solve a linear matrix equation, or system of linear scalar equations.
svdfunctionnp.linalg.svd documented
signature
np.linalg.svd(a: ArrayLike, opts?: SvdOptions | undefined): SvdResult
Singular Value Decomposition.
svdvalsfunctionnp.linalg.svdvals documented
signature
np.linalg.svdvals(x: ArrayLike): NDArray
Returns the singular values of a matrix (or a stack of matrices) x. When x is a stack of matrices, the function will compute the singular values for each matrix in the stack.
tensordotfunctionnp.linalg.tensordot documented
signature
np.linalg.tensordot(a: ArrayLike, b: ArrayLike, opts?: TensordotOptions | undefined): NDArray
Compute tensor dot product along specified axes.
tensorinvfunctionnp.linalg.tensorinv documented
signature
np.linalg.tensorinv(a: ArrayLike, opts?: TensorinvOptions | undefined): NDArray
Compute the 'inverse' of an N-dimensional array.
tensorsolvefunctionnp.linalg.tensorsolve documented
signature
np.linalg.tensorsolve(a: ArrayLike, b: ArrayLike, opts?: TensorsolveOptions | undefined): NDArray
Solve the tensor equation a x = b for x.
tracefunctionnp.linalg.trace documented
signature
np.linalg.trace(x: ArrayLike, opts?: { offset?: number | undefined; dtype?: DTypeLike | null | undefined; } | undefined): NDArray
Returns the sum along the specified diagonals of a matrix (or a stack of matrices) x.
vecdotfunctionnp.linalg.vecdot documented
signature
np.linalg.vecdot(x1: ArrayLike, x2: ArrayLike, opts?: VecdotOptions | undefined): NDArray
Computes the vector dot product.
vector_normfunctionnp.linalg.vectorNorm documented
signature
np.linalg.vectorNorm(x: ArrayLike, opts?: VectorNormOptions | undefined): NDArray
Computes the vector norm of a vector (or batch of vectors) x.

numpy.ma# 218 / 224

NumPynumeraSummary
absfunctionnp.ma.abs
signature
np.ma.abs(a: ArrayLike | MaskedArray): MaskedArray
Calculate the absolute value element-wise.
absolutefunctionnp.ma.absolute
signature
np.ma.absolute(a: ArrayLike | MaskedArray): MaskedArray
Calculate the absolute value element-wise.
addfunctionnp.ma.add
signature
np.ma.add(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Add arguments element-wise.
allfunctionnp.ma.all
signature
np.ma.all(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Returns True if all elements evaluate to True.
allclosefunctionnp.ma.allclose
signature
np.ma.allclose(a: MaOperand, b: MaOperand, masked_equal?: boolean | undefined, rtol?: number | undefined, atol?: number | undefined): boolean
Returns True if two arrays are element-wise equal within a tolerance.
allequalfunctionnp.ma.allequal
signature
np.ma.allequal(a: MaOperand, b: MaOperand, fill_value?: boolean | undefined): boolean
Return True if all entries of a and b are equal, using fill_value as a truth value where either or both are masked.
alltruefunctionnp.ma.alltrue
signature
np.ma.alltrue(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Reduce target along the given axis.
amaxfunctionnp.ma.amax
signature
np.ma.amax(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Return the maximum of an array or maximum along an axis.
aminfunctionnp.ma.amin
signature
np.ma.amin(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Return the minimum of an array or minimum along an axis.
anglefunctionnp.ma.angle
signature
np.ma.angle(a: ArrayLike | MaskedArray): MaskedArray
Return the angle of the complex argument.
anomfunctionnp.ma.anom
signature
np.ma.anom(a: MaOperand, opts?: { axis?: number | null | undefined; } | undefined): MaskedArray
Compute the anomalies (deviations from the arithmetic mean) along the given axis.
anomaliesfunctionnp.ma.anomalies
signature
np.ma.anomalies(a: MaOperand, opts?: { axis?: number | null | undefined; } | undefined): MaskedArray
Compute the anomalies (deviations from the arithmetic mean) along the given axis.
anyfunctionnp.ma.any
signature
np.ma.any(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Returns True if any of the elements of a evaluate to True.
appendfunctionnp.ma.append
signature
np.ma.append(a: MaOperand, b: MaOperand, axis?: number | undefined): MaskedArray
Append values to the end of an array.
apply_along_axisfunctionnot implementedApply a function to 1-D slices along the given axis.
apply_over_axesfunctionnot implementedApply a function repeatedly over multiple axes.
arangefunctionnp.ma.arange
signature
np.ma.arange(start: number, stop?: number | undefined, step?: number | undefined, opts?: { dtype?: DTypeLike | undefined; } | undefined): MaskedArray
Return evenly spaced values within a given interval.
arccosfunctionnp.ma.arccos
signature
np.ma.arccos(a: ArrayLike | MaskedArray): MaskedArray
Trigonometric inverse cosine, element-wise.
arccoshfunctionnp.ma.arccosh
signature
np.ma.arccosh(a: ArrayLike | MaskedArray): MaskedArray
Inverse hyperbolic cosine, element-wise.
arcsinfunctionnp.ma.arcsin
signature
np.ma.arcsin(a: ArrayLike | MaskedArray): MaskedArray
Inverse sine, element-wise.
arcsinhfunctionnp.ma.arcsinh
signature
np.ma.arcsinh(a: ArrayLike | MaskedArray): MaskedArray
Inverse hyperbolic sine, element-wise.
arctanfunctionnp.ma.arctan
signature
np.ma.arctan(a: ArrayLike | MaskedArray): MaskedArray
Trigonometric inverse tangent, element-wise.
arctan2functionnp.ma.arctan2
signature
np.ma.arctan2(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
arctanhfunctionnp.ma.arctanh
signature
np.ma.arctanh(a: ArrayLike | MaskedArray): MaskedArray
Inverse hyperbolic tangent, element-wise.
argmaxfunctionnp.ma.argmax
signature
np.ma.argmax(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray
Returns array of indices of the maximum values along the given axis. Masked values are treated as if they had the value fill_value.
argminfunctionnp.ma.argmin
signature
np.ma.argmin(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray
Return array of indices to the minimum values along the given axis.
argsortfunctionnp.ma.argsort
signature
np.ma.argsort(a: ArrayLike | MaskedArray, opts?: { axis?: number | undefined; kind?: string | undefined; } | undefined): NDArray
Return an ndarray of indices that sort the array along the specified axis. Masked values are filled beforehand to fill_value.
aroundfunctionnp.ma.around
signature
np.ma.around(a: ArrayLike | MaskedArray, decimals?: number | undefined): MaskedArray
Round an array to the given number of decimals.
arrayfunctionnp.ma.array
signature
np.ma.array(data: ArrayLike | MaskedArray, opts?: MaskedArrayOptions | undefined): MaskedArray
An array class with possibly masked values.
asanyarrayfunctionnp.ma.asanyarray
signature
np.ma.asanyarray(data: ArrayLike | MaskedArray, dtype?: DTypeLike | undefined): MaskedArray
Convert the input to a masked array, conserving subclasses.
asarrayfunctionnp.ma.asarray
signature
np.ma.asarray(data: ArrayLike | MaskedArray, dtype?: DTypeLike | undefined): MaskedArray
Convert the input to a masked array of the given data-type.
atleast_1dfunctionnp.ma.atleast_1d
signature
np.ma.atleast_1d(...arys: MaOperand[]): MaskedArray[]
Convert inputs to arrays with at least one dimension.
atleast_2dfunctionnp.ma.atleast_2d
signature
np.ma.atleast_2d(...arys: MaOperand[]): MaskedArray[]
View inputs as arrays with at least two dimensions.
atleast_3dfunctionnp.ma.atleast_3d
signature
np.ma.atleast_3d(...arys: MaOperand[]): MaskedArray[]
View inputs as arrays with at least three dimensions.
averagefunctionnp.ma.average
signature
np.ma.average(a: MaOperand, opts?: { axis?: number | null | undefined; weights?: NDArray | number[] | null | undefined; returned?: boolean | undefined; } | undefined): MaskedArray | [MaskedArray, NDArray]
Return the weighted average of array over the given axis.
bitwise_andfunctionnp.ma.bitwise_and
signature
np.ma.bitwise_and(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Compute the bit-wise AND of two arrays element-wise.
bitwise_orfunctionnp.ma.bitwise_or
signature
np.ma.bitwise_or(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Compute the bit-wise OR of two arrays element-wise.
bitwise_xorfunctionnp.ma.bitwise_xor
signature
np.ma.bitwise_xor(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Compute the bit-wise XOR of two arrays element-wise.
bool_classnp.ma.bool_
signature
np.ma.bool_: DType
Boolean type (True or False), stored as a byte.
ceilfunctionnp.ma.ceil
signature
np.ma.ceil(a: ArrayLike | MaskedArray): MaskedArray
Return the ceiling of the input, element-wise.
choosefunctionnp.ma.choose
signature
np.ma.choose(a: MaOperand, choices: MaOperand[]): MaskedArray
Use an index array to construct a new array from a list of choices.
clipfunctionnp.ma.clip
signature
np.ma.clip(a: MaOperand, a_min: number | null, a_max: number | null): MaskedArray
Clip (limit) the values in an array.
clump_maskedfunctionnp.ma.clump_masked
signature
np.ma.clump_masked(a: MaOperand): [number, number][]
Returns a list of slices corresponding to the masked clumps of a 1-D array. (A "clump" is defined as a contiguous region of the array).
clump_unmaskedfunctionnp.ma.clump_unmasked
signature
np.ma.clump_unmasked(a: MaOperand, _axis?: number | undefined): [number, number][]
Return list of slices corresponding to the unmasked clumps of a 1-D array. (A "clump" is defined as a contiguous region of the array).
column_stackfunctionnp.ma.column_stack
signature
np.ma.column_stack(tup: MaOperand[]): MaskedArray
Stack 1-D arrays as columns into a 2-D array.
common_fill_valuefunctionnp.ma.common_fill_value
signature
np.ma.common_fill_value(a: MaskedArray, b: MaskedArray): number | boolean | MaskedArray
Return the common filling value of two masked arrays, if any.
compressfunctionnp.ma.compress
signature
np.ma.compress(condition: NDArray | boolean[], a: MaOperand, axis?: number | null | undefined): MaskedArray
Return a where condition is True.
compress_colsfunctionnp.ma.compress_cols
signature
np.ma.compress_cols(x: ArrayLike | MaskedArray): MaskedArray
Suppress whole columns of a 2-D array that contain masked values.
compress_ndfunctionnp.ma.compress_nd
signature
np.ma.compress_nd(x: MaOperand, axis?: number | number[] | undefined): MaskedArray
Suppress slices from multiple dimensions which contain masked values.
compress_rowcolsfunctionnp.ma.compress_rowcols
signature
np.ma.compress_rowcols(x: ArrayLike | MaskedArray): MaskedArray
Suppress the rows and/or columns of a 2-D array that contain masked values.
compress_rowsfunctionnp.ma.compress_rows
signature
np.ma.compress_rows(x: ArrayLike | MaskedArray): MaskedArray
Suppress whole rows of a 2-D array that contain masked values.
compressedfunctionnot implementedReturn all the non-masked data as a 1-D array.
concatenatefunctionnp.ma.concatenate
signature
np.ma.concatenate(arrays: (ArrayLike | MaskedArray)[], axis?: number | undefined): MaskedArray
Concatenate a sequence of arrays along the given axis.
conjugatefunctionnp.ma.conjugate
signature
np.ma.conjugate(a: ArrayLike | MaskedArray): MaskedArray
Return the complex conjugate, element-wise.
convolvefunctionnp.ma.convolve
signature
np.ma.convolve(a: MaOperand, v: MaOperand, mode?: string | undefined): MaskedArray
Returns the discrete, linear convolution of two one-dimensional sequences.
copyfunctionnp.ma.copy
signature
np.ma.copy(a: ArrayLike | MaskedArray): MaskedArray
Return a copy of the array.
corrcoeffunctionnp.ma.corrcoef
signature
np.ma.corrcoef(x: MaOperand, y?: MaOperand | undefined): MaskedArray
Return Pearson product-moment correlation coefficients.
correlatefunctionnp.ma.correlate
signature
np.ma.correlate(a: MaOperand, v: MaOperand, mode?: string | undefined): MaskedArray
Cross-correlation of two 1-dimensional sequences.
cosfunctionnp.ma.cos
signature
np.ma.cos(a: ArrayLike | MaskedArray): MaskedArray
Cosine element-wise.
coshfunctionnp.ma.cosh
signature
np.ma.cosh(a: ArrayLike | MaskedArray): MaskedArray
Hyperbolic cosine, element-wise.
countfunctionnp.ma.count
signature
np.ma.count(a: NDArray | MaskedArray, _axis?: number | null | undefined): number
Count the non-masked elements of the array along the given axis.
count_maskedfunctionnp.ma.count_masked
signature
np.ma.count_masked(arr: NDArray | MaskedArray, _axis?: number | null | undefined): number
Count the number of masked elements along the given axis.
covfunctionnp.ma.cov
signature
np.ma.cov(m: MaOperand, y?: MaOperand | undefined): MaskedArray
Estimate the covariance matrix.
cumprodfunctionnp.ma.cumprod
signature
np.ma.cumprod(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; dtype?: DTypeLike | undefined; } | undefined): MaskedArray
Return the cumulative product of the array elements over the given axis.
cumsumfunctionnp.ma.cumsum
signature
np.ma.cumsum(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; dtype?: DTypeLike | undefined; } | undefined): MaskedArray
Return the cumulative sum of the array elements over the given axis.
default_fill_valuefunctionnp.ma.default_fill_value
signature
np.ma.default_fill_value(obj: number | boolean | NDArray | MaskedArray): number | boolean
Return the default fill value for the argument object.
diagfunctionnp.ma.diag
signature
np.ma.diag(a: MaOperand, k?: number | undefined): MaskedArray
Extract a diagonal or construct a diagonal array.
diagflatfunctionnp.ma.diagflat
signature
np.ma.diagflat(a: MaOperand, k?: number | undefined): MaskedArray
Create a two-dimensional array with the flattened input as a diagonal.
diagonalfunctionnp.ma.diagonal
signature
np.ma.diagonal(a: MaOperand, offset?: number | undefined, axis1?: number | undefined, axis2?: number | undefined): MaskedArray
Return specified diagonals. In NumPy 1.9 the returned array is a read-only view instead of a copy as in previous NumPy versions. In a future version the read-only restriction will be removed.
difffunctionnp.ma.diff
signature
np.ma.diff(a: MaOperand, n?: number | undefined, axis?: number | undefined): MaskedArray
Calculate the n-th discrete difference along the given axis. The first difference is given by out[i] = a[i+1] - a[i] along the given axis, higher differences are calculated by using diff recursively. Preserves the input mask.
dividefunctionnp.ma.divide
signature
np.ma.divide(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Divide arguments element-wise.
dotfunctionnp.ma.dot
signature
np.ma.dot(a: MaOperand, b: MaOperand): MaskedArray
Return the dot product of two arrays.
dstackfunctionnp.ma.dstack
signature
np.ma.dstack(tup: MaOperand[]): MaskedArray
Stack arrays in sequence depth wise (along third axis).
ediff1dfunctionnp.ma.ediff1d
signature
np.ma.ediff1d(ary: MaOperand, to_end?: number | number[] | null | undefined, to_begin?: number | number[] | null | undefined): MaskedArray
Compute the differences between consecutive elements of an array.
emptyfunctionnp.ma.empty
signature
np.ma.empty(shape: number | Shape, opts?: { dtype?: DTypeLike | undefined; } | undefined): MaskedArray
Return a new array of given shape and type, without initializing entries.
empty_likefunctionnp.ma.empty_like
signature
np.ma.empty_like(a: NDArray | MaskedArray): MaskedArray
Return a new array with the same shape and type as a given array.
equalfunctionnp.ma.equal
signature
np.ma.equal(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Return (x1 == x2) element-wise.
expfunctionnp.ma.exp
signature
np.ma.exp(a: ArrayLike | MaskedArray): MaskedArray
Calculate the exponential of all elements in the input array.
expand_dimsfunctionnp.ma.expand_dims
signature
np.ma.expand_dims(a: MaOperand, axis: number): MaskedArray
Expand the shape of an array.
fabsfunctionnp.ma.fabs
signature
np.ma.fabs(a: ArrayLike | MaskedArray): MaskedArray
Compute the absolute values element-wise.
filledfunctionnp.ma.filled
signature
np.ma.filled(a: NDArray | MaskedArray, fill_value?: number | boolean | undefined): NDArray
Return input as an ~numpy.ndarray, with masked values replaced by fill_value.
fix_invalidfunctionnp.ma.fix_invalid
signature
np.ma.fix_invalid(a: ArrayLike | MaskedArray, fill_value?: number | undefined): MaskedArray
Return input with invalid data masked and replaced by a fill value.
flatnotmasked_contiguousfunctionnp.ma.flatnotmasked_contiguous
signature
np.ma.flatnotmasked_contiguous(a: MaOperand, _axis?: number | undefined): [number, number][]
Find contiguous unmasked data in a masked array.
flatnotmasked_edgesfunctionnp.ma.flatnotmasked_edges
signature
np.ma.flatnotmasked_edges(a: MaOperand, _axis?: number | undefined): [number, number] | null
Find the indices of the first and last unmasked values.
flatten_maskfunctionnp.ma.flatten_mask
signature
np.ma.flatten_mask(mask: boolean | NDArray): false | NDArray
Returns a completely flattened version of the mask, where nested fields are collapsed.
flatten_structured_arrayfunctionnp.ma.flatten_structured_array
signature
np.ma.flatten_structured_array(a: ArrayLike | MaskedArray): MaskedArray
Flatten a structured array.
floorfunctionnp.ma.floor
signature
np.ma.floor(a: ArrayLike | MaskedArray): MaskedArray
Return the floor of the input, element-wise.
floor_dividefunctionnp.ma.floor_divide
signature
np.ma.floor_divide(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Return the largest integer smaller or equal to the division of the inputs. It is equivalent to the Python // operator and pairs with the Python % (remainder), function so that a = a % b + b * (a // b) up to roundoff.
fmodfunctionnp.ma.fmod
signature
np.ma.fmod(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Returns the element-wise remainder of division.
frombufferfunctionnot implementedInterpret a buffer as a 1-dimensional array.
fromflexfunctionnot implementedBuild a masked array from a suitable flexible-type array.
fromfunctionfunctionnot implementedConstruct an array by executing a function over each coordinate.
getdatafunctionnp.ma.getdata
signature
np.ma.getdata(a: NDArray | MaskedArray): NDArray
Return the data of a masked array as an ndarray.
getmaskfunctionnp.ma.getmask
signature
np.ma.getmask(a: NDArray | MaskedArray): false | NDArray
Return the mask of a masked array, or nomask.
getmaskarrayfunctionnp.ma.getmaskarray
signature
np.ma.getmaskarray(a: NDArray | MaskedArray): NDArray
Return the mask of a masked array, or full boolean array of False.
greaterfunctionnp.ma.greater
signature
np.ma.greater(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Return the truth value of (x1 > x2) element-wise.
greater_equalfunctionnp.ma.greater_equal
signature
np.ma.greater_equal(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Return the truth value of (x1 >= x2) element-wise.
harden_maskfunctionnp.ma.harden_mask
signature
np.ma.harden_mask(a: MaskedArray): MaskedArray
Force the mask to hard, preventing unmasking by assignment.
hsplitfunctionnp.ma.hsplit
signature
np.ma.hsplit(a: MaOperand, n: number): MaskedArray[]
Split an array into multiple sub-arrays horizontally (column-wise).
hstackfunctionnp.ma.hstack
signature
np.ma.hstack(tup: MaOperand[]): MaskedArray
Stack arrays in sequence horizontally (column wise).
hypotfunctionnp.ma.hypot
signature
np.ma.hypot(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Given the "legs" of a right triangle, return its hypotenuse.
identityfunctionnp.ma.identity
signature
np.ma.identity(n: number, dtype?: DTypeLike | undefined): MaskedArray
Return the identity array.
idsfunctionnp.ma.ids
signature
np.ma.ids(a: MaskedArray): [number, number]
Return the addresses of the data and mask areas.
in1dfunctionnp.ma.in1d
signature
np.ma.in1d(ar1: ArrayLike | MaskedArray, ar2: ArrayLike | MaskedArray): MaskedArray
Test whether each element of an array is also present in a second array.
indicesfunctionnp.ma.indices
signature
np.ma.indices(dimensions: number[], dtype?: DTypeLike | undefined): MaskedArray
Return an array representing the indices of a grid.
innerfunctionnp.ma.inner
signature
np.ma.inner(a: MaOperand, b: MaOperand): MaskedArray
Inner product of two arrays.
innerproductfunctionnp.ma.innerproduct
signature
np.ma.innerproduct(a: MaOperand, b: MaOperand): MaskedArray
Inner product of two arrays.
intersect1dfunctionnp.ma.intersect1d
signature
np.ma.intersect1d(ar1: ArrayLike | MaskedArray, ar2: ArrayLike | MaskedArray): NDArray
Returns the unique elements common to both arrays.
is_maskfunctionnp.ma.is_mask
signature
np.ma.is_mask(m: unknown): boolean
Return True if m is a valid, standard mask.
is_maskedfunctionnp.ma.is_masked
signature
np.ma.is_masked(a: unknown): boolean
Determine whether input has masked values.
isarrayfunctionnp.ma.isarray
signature
np.ma.isarray(a: unknown): a is MaskedArray
Test whether input is an instance of MaskedArray.
isinfunctionnp.ma.isin
signature
np.ma.isin(ar1: ArrayLike | MaskedArray, ar2: ArrayLike | MaskedArray): MaskedArray
Calculates element in test_elements, broadcasting over element only.
isMAfunctionnp.ma.isMA
signature
np.ma.isMA(a: unknown): a is MaskedArray
Test whether input is an instance of MaskedArray.
isMaskedArrayfunctionnp.ma.isMaskedArray
signature
np.ma.isMaskedArray(a: unknown): a is MaskedArray
Test whether input is an instance of MaskedArray.
left_shiftfunctionnp.ma.left_shift
signature
np.ma.left_shift(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Shift the bits of an integer to the left.
lessfunctionnp.ma.less
signature
np.ma.less(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Return the truth value of (x1 < x2) element-wise.
less_equalfunctionnp.ma.less_equal
signature
np.ma.less_equal(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Return the truth value of (x1 <= x2) element-wise.
logfunctionnp.ma.log
signature
np.ma.log(a: ArrayLike | MaskedArray): MaskedArray
Natural logarithm, element-wise.
log10functionnp.ma.log10
signature
np.ma.log10(a: ArrayLike | MaskedArray): MaskedArray
Return the base 10 logarithm of the input array, element-wise.
log2functionnp.ma.log2
signature
np.ma.log2(a: ArrayLike | MaskedArray): MaskedArray
Base-2 logarithm of x.
logical_andfunctionnp.ma.logical_and
signature
np.ma.logical_and(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Compute the truth value of x1 AND x2 element-wise.
logical_notfunctionnp.ma.logical_not
signature
np.ma.logical_not(a: ArrayLike | MaskedArray): MaskedArray
Compute the truth value of NOT x element-wise.
logical_orfunctionnp.ma.logical_or
signature
np.ma.logical_or(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Compute the truth value of x1 OR x2 element-wise.
logical_xorfunctionnp.ma.logical_xor
signature
np.ma.logical_xor(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Compute the truth value of x1 XOR x2, element-wise.
MAErrorclassnp.ma.MAError
signature
new np.ma.MAError(message: string, code?: string | undefined)
Class for masked array related errors.
make_maskfunctionnp.ma.make_mask
signature
np.ma.make_mask(m: MaskLike, copy?: boolean | undefined, shrink?: boolean | undefined, dtype?: DTypeLike | undefined): false | NDArray
Create a boolean mask from an array.
make_mask_descrfunctionnp.ma.make_mask_descr
signature
np.ma.make_mask_descr(_ndtype: unknown): "bool"
Construct a dtype description list from a given dtype.
make_mask_nonefunctionnp.ma.make_mask_none
signature
np.ma.make_mask_none(newshape: number | Shape, dtype?: DTypeLike | undefined): NDArray
Return a boolean mask of the given shape, filled with False.
mask_colsfunctionnp.ma.mask_cols
signature
np.ma.mask_cols(a: MaOperand): MaskedArray
Mask columns of a 2D array that contain masked values.
mask_orfunctionnp.ma.mask_or
signature
np.ma.mask_or(m1: false | NDArray | null, m2: false | NDArray | null, copy?: boolean | undefined, shrink?: boolean | undefined): false | NDArray
Combine two masks with the logical_or operator.
mask_rowcolsfunctionnp.ma.mask_rowcols
signature
np.ma.mask_rowcols(a: ArrayLike | MaskedArray): MaskedArray
Mask rows and/or columns of a 2D array that contain masked values.
mask_rowsfunctionnp.ma.mask_rows
signature
np.ma.mask_rows(a: MaOperand): MaskedArray
Mask rows of a 2D array that contain masked values.
maskedconstantnp.ma.masked
signature
np.ma.masked: MaskedArray
masked_allfunctionnp.ma.masked_all
signature
np.ma.masked_all(shape: number | Shape, dtype?: DTypeLike | undefined): MaskedArray
Empty masked array with all elements masked.
masked_all_likefunctionnp.ma.masked_all_like
signature
np.ma.masked_all_like(a: NDArray | MaskedArray): MaskedArray
Empty masked array with the properties of an existing array.
masked_arrayclassnp.ma.masked_array
signature
np.ma.masked_array(data: ArrayLike | MaskedArray, opts?: MaskedArrayOptions | undefined): MaskedArray
An array class with possibly masked values.
masked_equalfunctionnp.ma.masked_equal
signature
np.ma.masked_equal(a: ArrayLike | MaskedArray, value: number): MaskedArray
Mask an array where equal to a given value.
masked_greaterfunctionnp.ma.masked_greater
signature
np.ma.masked_greater(a: ArrayLike | MaskedArray, value: number): MaskedArray
Mask an array where greater than a given value.
masked_greater_equalfunctionnp.ma.masked_greater_equal
signature
np.ma.masked_greater_equal(a: ArrayLike | MaskedArray, value: number): MaskedArray
Mask an array where greater than or equal to a given value.
masked_insidefunctionnp.ma.masked_inside
signature
np.ma.masked_inside(a: ArrayLike | MaskedArray, v1: number, v2: number): MaskedArray
Mask an array inside a given interval.
masked_invalidfunctionnp.ma.masked_invalid
signature
np.ma.masked_invalid(a: ArrayLike | MaskedArray, copy?: boolean | undefined): MaskedArray
Mask an array where invalid values occur (NaNs or infs).
masked_lessfunctionnp.ma.masked_less
signature
np.ma.masked_less(a: ArrayLike | MaskedArray, value: number): MaskedArray
Mask an array where less than a given value.
masked_less_equalfunctionnp.ma.masked_less_equal
signature
np.ma.masked_less_equal(a: ArrayLike | MaskedArray, value: number): MaskedArray
Mask an array where less than or equal to a given value.
masked_not_equalfunctionnp.ma.masked_not_equal
signature
np.ma.masked_not_equal(a: ArrayLike | MaskedArray, value: number): MaskedArray
Mask an array where not equal to a given value.
masked_objectfunctionnp.ma.masked_object
signature
np.ma.masked_object(a: ArrayLike | MaskedArray, value: unknown, copy?: boolean | undefined): MaskedArray
Mask the array x where the data are exactly equal to value.
masked_outsidefunctionnp.ma.masked_outside
signature
np.ma.masked_outside(a: ArrayLike | MaskedArray, v1: number, v2: number): MaskedArray
Mask an array outside a given interval.
masked_print_optionconstantnp.ma.masked_print_option
signature
np.ma.masked_print_option: MaskedPrintOption
Handle the string used to represent missing data in a masked array.
masked_singletonconstantnp.ma.masked_singleton
signature
np.ma.masked_singleton: MaskedArray
masked_valuesfunctionnp.ma.masked_values
signature
np.ma.masked_values(a: ArrayLike | MaskedArray, value: number, opts?: { rtol?: number | undefined; atol?: number | undefined; copy?: boolean | undefined; } | undefined): MaskedArray
Mask using floating point equality.
masked_wherefunctionnp.ma.masked_where
signature
np.ma.masked_where(condition: ArrayLike | boolean[], a: ArrayLike | MaskedArray, copy?: boolean | undefined): MaskedArray
Mask an array where a condition is met.
MaskedArrayclassnp.ma.masked_array
signature
np.ma.masked_array(data: ArrayLike | MaskedArray, opts?: MaskedArrayOptions | undefined): MaskedArray
An array class with possibly masked values.
MaskErrorclassnp.ma.MaskError
signature
new np.ma.MaskError(message: string, code?: string | undefined)
Class for mask related errors.
MaskTypeclassnp.ma.MaskType
signature
np.ma.MaskType: "bool"
Boolean type (True or False), stored as a byte.
maxfunctionnp.ma.max
signature
np.ma.max(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Return the maximum along a given axis.
maximumfunctionnp.ma.maximum
signature
np.ma.maximum(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Element-wise maximum of array elements.
maximum_fill_valuefunctionnp.ma.maximum_fill_value
signature
np.ma.maximum_fill_value(obj: NDArray | MaskedArray): number | boolean
Return the minimum value that can be represented by the dtype of an object.
meanfunctionnp.ma.mean
signature
np.ma.mean(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; dtype?: DTypeLike | undefined; } | undefined): NDArray | MaskedArray
Returns the average of the array elements along given axis.
medianfunctionnp.ma.median
signature
np.ma.median(a: MaOperand, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Compute the median along the specified axis.
minfunctionnp.ma.min
signature
np.ma.min(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Return the minimum along a given axis.
minimumfunctionnp.ma.minimum
signature
np.ma.minimum(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Element-wise minimum of array elements.
minimum_fill_valuefunctionnp.ma.minimum_fill_value
signature
np.ma.minimum_fill_value(obj: NDArray | MaskedArray): number | boolean
Return the maximum value that can be represented by the dtype of an object.
modfunctionnp.ma.mod
signature
np.ma.mod(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Returns the element-wise remainder of division.
mr_constantnp.ma.mr_
signature
np.ma.mr_(...arrays: (ArrayLike | MaskedArray)[]): MaskedArray
Translate slice objects to concatenation along the first axis.
multiplyfunctionnp.ma.multiply
signature
np.ma.multiply(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Multiply arguments element-wise.
mvoidclassnp.ma.mvoid
signature
new np.ma.mvoid(data: NDArray, mask: false | NDArray)
Fake a 'void' object to use for masked array with structured dtypes.
ndenumeratefunctionnp.ma.ndenumerate
signature
np.ma.ndenumerate(a: MaOperand): [number[], number | boolean | MaskedArray][]
Multidimensional index iterator.
ndimfunctionnp.ma.ndim
signature
np.ma.ndim(a: ArrayLike | MaskedArray): number
Return the number of dimensions of an array.
negativefunctionnp.ma.negative
signature
np.ma.negative(a: ArrayLike | MaskedArray): MaskedArray
Numerical negation, element-wise.
nomaskconstantnp.ma.nomask
signature
np.ma.nomask: false
bool(value=False, /) --
nonzerofunctionnp.ma.nonzero
signature
np.ma.nonzero(a: MaOperand): NDArray[]
Return the indices of unmasked elements that are not zero.
not_equalfunctionnp.ma.not_equal
signature
np.ma.not_equal(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Return (x1 != x2) element-wise.
notmasked_contiguousfunctionnp.ma.notmasked_contiguous
signature
np.ma.notmasked_contiguous(a: MaOperand, _axis?: number | undefined): [number, number][]
Find contiguous unmasked data in a masked array along the given axis.
notmasked_edgesfunctionnp.ma.notmasked_edges
signature
np.ma.notmasked_edges(a: MaOperand, _axis?: number | undefined): [number, number] | null
Find the indices of the first and last unmasked values along an axis.
onesfunctionnp.ma.ones
signature
np.ma.ones(shape: number | Shape, opts?: { dtype?: DTypeLike | undefined; } | undefined): MaskedArray
Return a new array of given shape and type, filled with ones.
ones_likefunctionnp.ma.ones_like
signature
np.ma.ones_like(a: NDArray | MaskedArray): MaskedArray
Return an array of ones with the same shape and type as a given array.
outerfunctionnp.ma.outer
signature
np.ma.outer(a: MaOperand, b: MaOperand): MaskedArray
Compute the outer product of two vectors.
outerproductfunctionnp.ma.outerproduct
signature
np.ma.outerproduct(a: MaOperand, b: MaOperand): MaskedArray
Compute the outer product of two vectors.
polyfitfunctionnp.ma.polyfit
signature
np.ma.polyfit(x: MaOperand, y: MaOperand, deg: number): NDArray
Least squares polynomial fit.
powerfunctionnp.ma.power
signature
np.ma.power(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Returns element-wise base array raised to power from second array.
prodfunctionnp.ma.prod
signature
np.ma.prod(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; dtype?: DTypeLike | undefined; } | undefined): NDArray | MaskedArray
Return the product of the array elements over the given axis.
productfunctionnp.ma.product
signature
np.ma.product(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; dtype?: DTypeLike | undefined; } | undefined): NDArray | MaskedArray
Return the product of the array elements over the given axis.
ptpfunctionnp.ma.ptp
signature
np.ma.ptp(a: MaOperand, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Return (maximum - minimum) along the given dimension (i.e. peak-to-peak value).
putfunctionnp.ma.put
signature
np.ma.put(a: MaskedArray, indices: NDArray | number[], values: ArrayLike | MaskedArray): void
Set storage-indexed locations to corresponding values.
putmaskfunctionnp.ma.putmask
signature
np.ma.putmask(a: MaskedArray, mask: NDArray | boolean[], values: MaOperand): void
Changes elements of an array based on conditional and input values.
ravelfunctionnp.ma.ravel
signature
np.ma.ravel(a: ArrayLike | MaskedArray): MaskedArray
Returns a 1D version of self, as a view.
remainderfunctionnp.ma.remainder
signature
np.ma.remainder(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Returns the element-wise remainder of division.
repeatfunctionnp.ma.repeat
signature
np.ma.repeat(a: ArrayLike | MaskedArray, repeats: number | number[], axis?: number | null | undefined): MaskedArray
Repeat elements of an array.
reshapefunctionnp.ma.reshape
signature
np.ma.reshape(a: ArrayLike | MaskedArray, newshape: Shape): MaskedArray
Returns an array containing the same data with a new shape.
resizefunctionnp.ma.resize
signature
np.ma.resize(a: MaOperand, newshape: number | Shape): MaskedArray
Return a new masked array with the specified size and shape.
right_shiftfunctionnp.ma.right_shift
signature
np.ma.right_shift(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Shift the bits of an integer to the right.
roundfunctionnp.ma.round
signature
np.ma.round(a: ArrayLike | MaskedArray, decimals?: number | undefined): MaskedArray
Return a copy of a, rounded to 'decimals' places.
round_functionnp.ma.round
signature
np.ma.round(a: ArrayLike | MaskedArray, decimals?: number | undefined): MaskedArray
Return a copy of a, rounded to 'decimals' places.
row_stackfunctionnp.ma.row_stack
signature
np.ma.row_stack(tup: MaOperand[]): MaskedArray
Stack arrays in sequence vertically (row wise).
set_fill_valuefunctionnp.ma.set_fill_value
signature
np.ma.set_fill_value(a: MaskedArray, fill_value: number | boolean): void
Set the filling value of a, if a is a masked array.
setdiff1dfunctionnp.ma.setdiff1d
signature
np.ma.setdiff1d(ar1: ArrayLike | MaskedArray, ar2: ArrayLike | MaskedArray): NDArray
Set difference of 1D arrays with unique elements.
setxor1dfunctionnp.ma.setxor1d
signature
np.ma.setxor1d(ar1: ArrayLike | MaskedArray, ar2: ArrayLike | MaskedArray): NDArray
Set exclusive-or of 1-D arrays with unique elements.
shapefunctionnp.ma.shape
signature
np.ma.shape(a: ArrayLike | MaskedArray): number[]
Return the shape of an array.
sinfunctionnp.ma.sin
signature
np.ma.sin(a: ArrayLike | MaskedArray): MaskedArray
Trigonometric sine, element-wise.
sinhfunctionnp.ma.sinh
signature
np.ma.sinh(a: ArrayLike | MaskedArray): MaskedArray
Hyperbolic sine, element-wise.
sizefunctionnp.ma.size
signature
np.ma.size(a: ArrayLike | MaskedArray, axis?: number | undefined): number
Return the number of elements along a given axis.
soften_maskfunctionnp.ma.soften_mask
signature
np.ma.soften_mask(a: MaskedArray): MaskedArray
Force the mask to soft (default), allowing unmasking by assignment.
sometruefunctionnp.ma.sometrue
signature
np.ma.sometrue(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray | MaskedArray
Reduce target along the given axis.
sortfunctionnp.ma.sort
signature
np.ma.sort(a: ArrayLike | MaskedArray, opts?: { axis?: number | undefined; kind?: string | undefined; } | undefined): MaskedArray
Return a sorted copy of the masked array.
sqrtfunctionnp.ma.sqrt
signature
np.ma.sqrt(a: ArrayLike | MaskedArray): MaskedArray
Return the non-negative square-root of an array, element-wise.
squeezefunctionnp.ma.squeeze
signature
np.ma.squeeze(a: ArrayLike | MaskedArray, axis?: number | readonly number[] | undefined): MaskedArray
Remove axes of length one from a.
stackfunctionnp.ma.stack
signature
np.ma.stack(arrays: MaOperand[], axis?: number | undefined): MaskedArray
Join a sequence of arrays along a new axis.
stdfunctionnp.ma.std
signature
np.ma.std(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; ddof?: number | undefined; } | undefined): NDArray | MaskedArray
Returns the standard deviation of the array elements along given axis.
subtractfunctionnp.ma.subtract
signature
np.ma.subtract(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Subtract arguments, element-wise.
sumfunctionnp.ma.sum
signature
np.ma.sum(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; dtype?: DTypeLike | undefined; } | undefined): NDArray | MaskedArray
Return the sum of the array elements over the given axis.
swapaxesfunctionnp.ma.swapaxes
signature
np.ma.swapaxes(a: ArrayLike | MaskedArray, axis1: number, axis2: number): MaskedArray
Return a view of the array with axis1 and axis2 interchanged.
takefunctionnp.ma.take
signature
np.ma.take(a: ArrayLike | MaskedArray, indices: NDArray | number[], axis?: number | null | undefined): MaskedArray
tanfunctionnp.ma.tan
signature
np.ma.tan(a: ArrayLike | MaskedArray): MaskedArray
Compute tangent element-wise.
tanhfunctionnp.ma.tanh
signature
np.ma.tanh(a: ArrayLike | MaskedArray): MaskedArray
Hyperbolic tangent, element-wise.
tracefunctionnp.ma.trace
signature
np.ma.trace(a: MaOperand, offset?: number | undefined, axis1?: number | undefined, axis2?: number | undefined): NDArray | MaskedArray
Return the sum along diagonals of the array.
transposefunctionnp.ma.transpose
signature
np.ma.transpose(a: ArrayLike | MaskedArray, axes?: number[] | undefined): MaskedArray
Permute the dimensions of an array.
true_dividefunctionnp.ma.true_divide
signature
np.ma.true_divide(a: ArrayLike | MaskedArray, b: ArrayLike | MaskedArray): MaskedArray
Divide arguments element-wise.
union1dfunctionnp.ma.union1d
signature
np.ma.union1d(ar1: ArrayLike | MaskedArray, ar2: ArrayLike | MaskedArray): NDArray
Union of two arrays.
uniquefunctionnp.ma.unique
signature
np.ma.unique(a: ArrayLike | MaskedArray): NDArray
Finds the unique elements of an array.
vanderfunctionnp.ma.vander
signature
np.ma.vander(x: MaOperand, N?: number | undefined, increasing?: boolean | undefined): MaskedArray
Generate a Vandermonde matrix.
varfunctionnp.ma.var
signature
np.ma.var(a: ArrayLike | MaskedArray, opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; ddof?: number | undefined; } | undefined): NDArray | MaskedArray
Compute the variance along the specified axis.
vstackfunctionnp.ma.vstack
signature
np.ma.vstack(tup: MaOperand[]): MaskedArray
Stack arrays in sequence vertically (row wise).
wherefunctionnp.ma.where
signature
np.ma.where(condition: MaOperand, x?: MaOperand | undefined, y?: MaOperand | undefined): NDArray | MaskedArray
Return a masked array with elements from x or y, depending on condition.
zerosfunctionnp.ma.zeros
signature
np.ma.zeros(shape: number | Shape, opts?: { dtype?: DTypeLike | undefined; } | undefined): MaskedArray
Return a new array of given shape and type, filled with zeros.
zeros_likefunctionnp.ma.zeros_like
signature
np.ma.zeros_like(a: NDArray | MaskedArray): MaskedArray
Return an array of zeros with the same shape and type as a given array.

numpy.ndarray# 62 / 62

NumPynumeraSummary
allmethoda.all documented
signature
a.all(opts?: AllAnyOptions | undefined): NDArray
Returns True if all elements evaluate to True.
anymethoda.any documented
signature
a.any(opts?: AllAnyOptions | undefined): NDArray
Returns True if any of the elements of a evaluate to True.
argmaxmethoda.argmax
signature
a.argmax(opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray
Return indices of the maximum values along the given axis.
argminmethoda.argmin
signature
a.argmin(opts?: { axis?: number | null | undefined; keepdims?: boolean | undefined; } | undefined): NDArray
Return indices of the minimum values along the given axis.
argpartitionmethoda.argpartition
signature
a.argpartition(kth: Kth, opts?: PartitionOptions | undefined): NDArray
Returns the indices that would partition this array.
argsortmethoda.argsort
signature
a.argsort(opts?: SortOptions | undefined): NDArray
Returns the indices that would sort this array.
astypemethoda.astype documented
signature
a.astype(dt: DTypeLike, opts?: AstypeOptions | undefined): NDArray
Copy of the array, cast to a specified type.
baseattributea.base documented
signature
a.base: NDArray | null
Base object if memory is from some other object.
byteswapmethoda.byteswap documented
signature
a.byteswap(opts?: { inplace?: boolean | undefined; } | undefined): NDArray
Swap the bytes of the array elements
choosemethoda.choose documented
signature
a.choose(choices: NDArray | readonly Operand[], opts?: ChooseOptions | undefined): NDArray
Use an index array to construct a new array from a set of choices.
clipmethoda.clip documented
signature
a.clip(min?: Operand | null | undefined, max?: Operand | null | undefined, opts?: ClipOptions | undefined): NDArray
Return an array whose values are limited to [min, max]. One of max or min must be given.
compressmethoda.compress documented
signature
a.compress(condition: ArrayLike, axis?: number | AxisOptions | null | undefined): NDArray
Return selected slices of this array along given axis.
conjmethoda.conj
signature
a.conj(): NDArray
Complex-conjugate all elements.
conjugatemethoda.conjugate
signature
a.conjugate(): NDArray
Return the complex conjugate, element-wise.
copymethoda.copy documented
signature
a.copy(opts?: OrderOptions | undefined): NDArray
Return a copy of the array.
cumprodmethoda.cumprod
signature
a.cumprod(opts?: CumsumOptions | undefined): NDArray
a.cumprod(axis?: number | CumOptions | null | undefined, opts?: CumOptions | undefined): NDArray
Return the cumulative product of the elements along the given axis.
cumsummethoda.cumsum
signature
a.cumsum(opts?: CumsumOptions | undefined): NDArray
a.cumsum(axis?: number | CumOptions | null | undefined, opts?: CumOptions | undefined): NDArray
Return the cumulative sum of the elements along the given axis.
diagonalmethoda.diagonal documented
signature
a.diagonal(opts?: number | DiagonalOptions | undefined): NDArray
Return specified diagonals. In NumPy 1.9 the returned array is a read-only view instead of a copy as in previous NumPy versions. In a future version the read-only restriction will be removed.
dotmethoda.dot documented
signature
a.dot(b: ArrayLike): NDArray
Refer to :func:numpy.dot for full documentation.
dtypeattributea.dtype documented
signature
a.dtype: DType
Data-type of the array's elements.
fillmethoda.fill documented
signature
a.fill(value: number | bigint | boolean | NDArray | ComplexLike): void
Fill the array with a scalar value.
flagsattributea.flags documented
signature
a.flags: ArrayFlags
Information about the memory layout of the array.
flatattributea.flat documented
signature
a.flat: FlatIter
A 1-D iterator over the array.
flattenmethoda.flatten
signature
a.flatten(opts?: OrderOptions | undefined): NDArray
Return a copy of the array collapsed into one dimension.
imagattributea.imag
signature
a.imag: NDArray
The imaginary part of the array.
itemmethoda.item documented
signature
a.item(...index: number[]): number | boolean | Complex
Copy an element of an array to a standard Python scalar and return it.
itemsizeattributea.itemSize documented
signature
a.itemSize: number
Length of one array element in bytes.
maxmethoda.max
signature
a.max(opts?: Omit<MethodReduceOptions, "dtype" | "ddof"> | undefined): NDArray
Return the maximum along a given axis.
meanmethoda.mean
signature
a.mean(opts?: Omit<MethodReduceOptions, "initial" | "ddof"> | undefined): NDArray
Returns the average of the array elements along given axis.
minmethoda.min
signature
a.min(opts?: Omit<MethodReduceOptions, "dtype" | "ddof"> | undefined): NDArray
Return the minimum along a given axis.
mTattributea.mT documented
signature
a.mT: NDArray
View of the matrix transposed array.
nbytesattributea.nbytes documented
signature
a.nbytes: number
Total bytes consumed by the elements of the array.
ndimattributea.ndim documented
signature
a.ndim: number
Number of array dimensions.
nonzeromethoda.nonzero documented
signature
a.nonzero(): NDArray[]
Return the indices of the elements that are non-zero.
partitionmethoda.partition
signature
a.partition(kth: Kth, opts?: (Omit<PartitionOptions, "axis"> & { axis?: number | undefined; }) | undefined): void
Partially sorts the elements in the array in such a way that the value of the element in k-th position is in the position it would be in a sorted array. In the output array, all elements smaller than the k-th element are located to the left of this element and all equal or greater are located to its right. The ordering of the elements in the two partitions on the either side of the k-th element in
prodmethoda.prod
signature
a.prod(opts?: MethodReduceOptions | undefined): NDArray
Return the product of the array elements over the given axis
putmethoda.put documented
signature
a.put(ind: ArrayLike, v: ArrayLike, opts?: PutOptions | undefined): void
Set a.flat[n] = values[n] for all n in indices.
ravelmethoda.ravel
signature
a.ravel(opts?: OrderOptions | undefined): NDArray
Return a flattened array.
realattributea.real
signature
a.real: NDArray
The real part of the array.
repeatmethoda.repeat documented
signature
a.repeat(repeats: number | NDArray | readonly number[], axis?: number | null | undefined): NDArray
Repeat elements of an array.
reshapemethoda.reshape documented
signature
a.reshape(shape: number | Shape, ...rest: (number | OrderOptions)[]): NDArray
Returns an array containing the same data with a new shape.
resizemethoda.resize documented
signature
a.resize(newShape: number | readonly number[], options?: ResizeOptions | undefined): void
a.resize(...dims: number[]): void
Change shape and size of array in-place.
roundmethoda.round documented
signature
a.round(decimals?: number | undefined, opts?: RoundOptions | undefined): NDArray
Return a with each element rounded to the given number of decimals.
searchsortedmethoda.searchsorted
signature
a.searchsorted(v: number | bigint | boolean | NDArray | Complex | { readonly re: number; readonly im?: number | undefined; } | readonly NestedArray[], opts?: SearchsortedOptions | undefined): NDArray
Find indices where elements of v should be inserted in a to maintain order.
setflagsmethoda.setflags documented
signature
a.setflags(opts?: { write?: boolean | null | undefined; align?: boolean | null | undefined; uic?: boolean | null | undefined; } | undefined): void
Set array flags WRITEABLE, ALIGNED, WRITEBACKIFCOPY, respectively.
shapeattributea.shape documented
signature
a.shape: number[]
Tuple of array dimensions.
sizeattributea.size documented
signature
a.size: number
Number of elements in the array.
sortmethoda.sort
signature
a.sort(opts?: (Omit<SortOptions, "axis"> & { axis?: number | undefined; }) | undefined): void
Sort an array in-place. Refer to numpy.sort for full documentation.
squeezemethoda.squeeze
signature
a.squeeze(axis?: number | readonly number[] | undefined): NDArray
Remove axes of length one from a.
stdmethoda.std
signature
a.std(opts?: Omit<MethodReduceOptions, "initial"> | undefined): NDArray
Returns the standard deviation of the array elements along given axis.
stridesattributea.strides documented
signature
a.strides: number[]
Tuple of bytes to step in each dimension when traversing an array.
summethoda.sum
signature
a.sum(opts?: MethodReduceOptions | undefined): NDArray
Return the sum of the array elements over the given axis.
swapaxesmethoda.swapAxes
signature
a.swapAxes(axis1: number, axis2: number): NDArray
Return a view of the array with axis1 and axis2 interchanged.
Tattributea.T documented
signature
a.T: NDArray
View of the transposed array.
takemethoda.take documented
signature
a.take(indices: ArrayLike, axis?: number | TakeOptions | null | undefined, opts?: TakeOptions | undefined): NDArray
Return an array formed from the elements of a at the given indices.
tobytesmethoda.tobytes documented
signature
a.tobytes(opts?: OrderOptions | undefined): Uint8Array<ArrayBufferLike>
Construct Python bytes containing the raw data bytes in the array.
tofilemethoda.tofile documented
signature
a.tofile(file: string | URL | null, options?: TofileOptions | undefined): any
Write array to a file as text or binary (default).
tolistmethoda.tolist documented
signature
a.tolist(): NestedArray
Return the array as an a.ndim-levels deep nested list of Python scalars.
tracemethoda.trace documented
signature
a.trace(opts?: number | TraceOptions | undefined): NDArray
Return the sum along diagonals of the array.
transposemethoda.transpose documented
signature
a.transpose(...axes: number[] | [readonly number[]]): NDArray
Returns a view of the array with axes transposed.
varmethoda.var
signature
a.var(opts?: Omit<MethodReduceOptions, "initial"> | undefined): NDArray
Returns the variance of the array elements, along given axis.
viewmethoda.view documented
signature
a.view(dt?: DTypeLike | undefined): NDArray
New view of array with the same data.

numpy# 431 / 431

NumPynumeraSummary
absufuncnp.abs documented
signature
np.abs(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Calculate the absolute value element-wise.
absoluteufuncnp.absolute documented
signature
np.absolute(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Calculate the absolute value element-wise.
acosufuncnp.acos documented
signature
np.acos(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Trigonometric inverse cosine, element-wise.
acoshufuncnp.acosh documented
signature
np.acosh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Inverse hyperbolic cosine, element-wise.
addufuncnp.add documented
signature
np.add(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Add arguments element-wise.
allfunctionnp.all documented
signature
np.all(a: ArrayLike, opts?: AllAnyOptions | undefined): NDArray
Test whether all array elements along a given axis evaluate to True.
allclosefunctionnp.allclose documented
signature
np.allclose(a: CloseOperand, b: CloseOperand, opts?: IscloseOptions | undefined): boolean
Returns True if two arrays are element-wise equal within a tolerance.
amaxfunctionnp.amax
signature
np.amax(a: ArrayLike, opts?: Omit<ReduceOptions, "dtype"> | undefined): NDArray
Return the maximum of an array or maximum along an axis.
aminfunctionnp.amin
signature
np.amin(a: ArrayLike, opts?: Omit<ReduceOptions, "dtype"> | undefined): NDArray
Return the minimum of an array or minimum along an axis.
anglefunctionnp.angle documented
signature
np.angle(z: ArrayLike, deg?: boolean | undefined): NDArray
Return the angle of the complex argument.
anyfunctionnp.any documented
signature
np.any(a: ArrayLike, opts?: AllAnyOptions | undefined): NDArray
Test whether any array element along a given axis evaluates to True.
appendfunctionnp.append documented
signature
np.append(arr: ArrayLike, values: ArrayLike, axis?: number | null | undefined): NDArray
Append values to the end of an array.
apply_along_axisfunctionnp.applyAlongAxis documented
signature
np.applyAlongAxis<A extends unknown[]>(func1d: (lane: NDArray, ...args: A) => ArrayLike, axis: number, arr: ArrayLike, ...args: A): NDArray
Apply a function to 1-D slices along the given axis.
apply_over_axesfunctionnp.applyOverAxes documented
signature
np.applyOverAxes(func: (a: NDArray, axis: number) => ArrayLike, a: ArrayLike, axes: number | readonly number[]): NDArray
Apply a function repeatedly over multiple axes.
arangefunctionnp.arange documented
signature
np.arange(startOrStop: number, stop?: number | undefined, step?: number | undefined, options?: ArrayOptions | undefined): NDArray
Return evenly spaced values within a given interval.
arccosufuncnp.arccos documented
signature
np.arccos(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Trigonometric inverse cosine, element-wise.
arccoshufuncnp.arccosh documented
signature
np.arccosh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Inverse hyperbolic cosine, element-wise.
arcsinufuncnp.arcsin documented
signature
np.arcsin(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Inverse sine, element-wise.
arcsinhufuncnp.arcsinh documented
signature
np.arcsinh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Inverse hyperbolic sine, element-wise.
arctanufuncnp.arctan documented
signature
np.arctan(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Trigonometric inverse tangent, element-wise.
arctan2ufuncnp.arctan2 documented
signature
np.arctan2(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
arctanhufuncnp.arctanh documented
signature
np.arctanh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Inverse hyperbolic tangent, element-wise.
argmaxfunctionnp.argmax documented
signature
np.argmax(a: ArrayLike, opts?: ArgReduceOptions | undefined): NDArray
Returns the indices of the maximum values along an axis.
argminfunctionnp.argmin documented
signature
np.argmin(a: ArrayLike, opts?: ArgReduceOptions | undefined): NDArray
Returns the indices of the minimum values along an axis.
argpartitionfunctionnp.argpartition documented
signature
np.argpartition(a: ArrayLike, kth: Kth, opts?: PartitionOptions | undefined): NDArray
Perform an indirect partition along the given axis using the algorithm specified by the kind keyword. It returns an array of indices of the same shape as a that index data along the given axis in partitioned order.
argsortfunctionnp.argsort documented
signature
np.argsort(a: ArrayLike, opts?: SortOptions | undefined): NDArray
Returns the indices that would sort an array.
argwherefunctionnp.argwhere documented
signature
np.argwhere(a: ArrayLike): NDArray
Find the indices of array elements that are non-zero, grouped by element.
aroundfunctionnp.around documented
signature
np.around(a: ArrayLike, decimals?: number | undefined, opts?: RoundOptions | undefined): NDArray
Round an array to the given number of decimals.
arrayfunctionnp.array documented
signature
np.array(data: NDArray | NestedArray, options?: ArrayCopyOptions | undefined): NDArray
Create an array.
array_equalfunctionnp.arrayEqual documented
signature
np.arrayEqual(a1: ArrayLike, a2: ArrayLike, opts?: { equalNan?: boolean | undefined; } | undefined): boolean
True if two arrays have the same shape and elements, False otherwise.
array_equivfunctionnp.arrayEquiv documented
signature
np.arrayEquiv(a1: ArrayLike, a2: ArrayLike): boolean
Returns True if input arrays are shape consistent and all elements equal.
array_reprfunctionnp.arrayRepr documented
signature
np.arrayRepr(a: AnyArray, opts?: ArrayReprOptions | undefined): string
Return the string representation of an array.
array_splitfunctionnp.arraySplit
signature
np.arraySplit(a: ArrayLike, indicesOrSections: number | NDArray | readonly number[], axis?: number | undefined): NDArray[]
Split an array into multiple sub-arrays.
array_strfunctionnp.arrayStr documented
signature
np.arrayStr(a: AnyArray, opts?: ArrayReprOptions | undefined): string
Return a string representation of the data in an array.
array2stringfunctionnp.array2string documented
signature
np.array2string(a: AnyArray, opts?: Array2StringOptions | undefined): string
Return a string representation of an array.
asanyarrayfunctionnp.asanyarray documented
signature
np.asanyarray(a: ArrayLike, options?: { dtype?: DTypeLike | undefined; } | undefined): NDArray
Convert the input to an ndarray, but pass ndarray subclasses through.
asarrayfunctionnp.asarray documented
signature
np.asarray(data: NDArray | NestedArray, options?: ArrayOptions | undefined): NDArray
Convert the input to an array.
asarray_chkfinitefunctionnp.asarrayChkfinite documented
signature
np.asarrayChkfinite(a: ArrayLike, options?: { dtype?: DTypeLike | undefined; } | undefined): NDArray
Convert the input to an array, checking for NaNs or Infs.
ascontiguousarrayfunctionnp.ascontiguousarray documented
signature
np.ascontiguousarray(a: NDArray | NestedArray, options?: ArrayOptions | undefined): NDArray
Return a contiguous array (ndim >= 1) in memory (C order).
asfortranarrayfunctionnp.asfortranarray documented
signature
np.asfortranarray(a: NDArray | NestedArray, options?: ArrayOptions | undefined): NDArray
Return an array (ndim >= 1) laid out in Fortran order in memory.
asinufuncnp.asin documented
signature
np.asin(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Inverse sine, element-wise.
asinhufuncnp.asinh documented
signature
np.asinh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Inverse hyperbolic sine, element-wise.
astypefunctionnp.astype documented
signature
np.astype(x: NDArray, dtype: DTypeLike, options?: Pick<AstypeOptions, "copy"> | undefined): NDArray
Copies an array to a specified data type.
atanufuncnp.atan documented
signature
np.atan(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Trigonometric inverse tangent, element-wise.
atan2ufuncnp.atan2 documented
signature
np.atan2(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
atanhufuncnp.atanh documented
signature
np.atanh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Inverse hyperbolic tangent, element-wise.
atleast_1dfunctionnp.atleast1d documented
signature
np.atleast1d(a: ArrayLike): NDArray
np.atleast1d(...arys: ArrayLike[]): NDArray | NDArray[]
Convert inputs to arrays with at least one dimension.
atleast_2dfunctionnp.atleast2d
signature
np.atleast2d(a: ArrayLike): NDArray
np.atleast2d(...arys: ArrayLike[]): NDArray | NDArray[]
View inputs as arrays with at least two dimensions.
atleast_3dfunctionnp.atleast3d
signature
np.atleast3d(a: ArrayLike): NDArray
np.atleast3d(...arys: ArrayLike[]): NDArray | NDArray[]
View inputs as arrays with at least three dimensions.
averagefunctionnp.average documented
signature
np.average(a: ArrayLike, opts: AverageOptions & { returned: true; }): [NDArray, NDArray]
np.average(a: ArrayLike, opts?: AverageOptions | undefined): NDArray
Compute the weighted average along the specified axis.
bartlettfunctionnp.bartlett documented
signature
np.bartlett(M: number | bigint | NDArray): NDArray
Return the Bartlett window.
base_reprfunctionnp.baseRepr documented
signature
np.baseRepr(number: IntegerLike, base?: number | undefined, padding?: number | undefined): string
Return a string representation of a number in the given base system.
binary_reprfunctionnp.binaryRepr documented
signature
np.binaryRepr(num: IntegerLike, options?: BinaryReprOptions | undefined): string
Return the binary representation of the input number as a string.
bincountfunctionnp.bincount documented
signature
np.bincount(x: ArrayLike, opts?: BincountOptions | undefined): NDArray
Count number of occurrences of each value in array of non-negative ints.
bitwise_andufuncnp.bitwiseAnd documented
signature
np.bitwiseAnd(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Compute the bit-wise AND of two arrays element-wise.
bitwise_countufuncnp.bitwiseCount documented
signature
np.bitwiseCount(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Computes the number of 1-bits in the absolute value of x. Analogous to the builtin int.bit_count or popcount in C++.
bitwise_invertufuncnp.bitwiseInvert
signature
np.bitwiseInvert(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Compute bit-wise inversion, or bit-wise NOT, element-wise.
bitwise_left_shiftufuncnp.bitwiseLeftShift documented
signature
np.bitwiseLeftShift(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Shift the bits of an integer to the left.
bitwise_notufuncnp.bitwiseNot
signature
np.bitwiseNot(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Compute bit-wise inversion, or bit-wise NOT, element-wise.
bitwise_orufuncnp.bitwiseOr documented
signature
np.bitwiseOr(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Compute the bit-wise OR of two arrays element-wise.
bitwise_right_shiftufuncnp.bitwiseRightShift documented
signature
np.bitwiseRightShift(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Shift the bits of an integer to the right.
bitwise_xorufuncnp.bitwiseXor documented
signature
np.bitwiseXor(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Compute the bit-wise XOR of two arrays element-wise.
blackmanfunctionnp.blackman documented
signature
np.blackman(M: number | bigint | NDArray): NDArray
Return the Blackman window.
blockfunctionnp.block documented
signature
np.block(arrays: BlockArg): NDArray
Assemble an nd-array from nested lists of blocks.
boolclassnp.bool
signature
np.bool: DType
Boolean type (True or False), stored as a byte.
bool_classnp.bool
signature
np.bool: DType
Boolean type (True or False), stored as a byte.
broadcast_arraysfunctionnp.broadcastArrays documented
signature
np.broadcastArrays(...args: ArrayLike[]): NDArray[]
Broadcast any number of arrays against each other.
broadcast_shapesfunctionnp.broadcastShapes documented
signature
np.broadcastShapes(...shapes: (number | Shape)[]): number[]
Broadcast the input shapes into a single shape.
broadcast_tofunctionnp.broadcastTo documented
signature
np.broadcastTo(a: ArrayLike, shape: number | Shape): NDArray
Broadcast an array to a new shape.
busday_countfunctionnp.busday_count documented
signature
np.busday_count(begindates: string | number | bigint | DatetimeArray, enddates: string | number | bigint | DatetimeArray, options?: BusdayCountOptions | undefined): number | number[]
Counts the number of valid days between begindates and enddates, not including the day of enddates.
busday_offsetfunctionnp.busday_offset documented
signature
np.busday_offset(dates: string | number | bigint | DatetimeArray | (string | number | bigint | DatetimeArray)[], offsets: number | number[], options?: BusdayOffsetOptions | undefined): DatetimeArray | DatetimeArray[] | null
First adjusts the date to fall on a valid day according to the roll rule, then applies offsets to the given dates counted in valid days.
byteclassnp.byte documented
signature
np.byte: DType
Signed integer type, compatible with C char.
bytes_classnp.bytes_ documented
signature
np.bytes_: "bytes"
A byte string.
c_constantnp.c_ documented
signature
np.c_(...items: ConcatItem[]): NDArray
Translates slice objects to concatenation along the second axis.
can_castfunctionnp.canCast documented
signature
np.canCast(from: DTypeLike | { readonly dtype: DType; }, to: DTypeLike, casting?: Casting | undefined): boolean
Returns True if cast between data types can occur according to the casting rule.
cbrtufuncnp.cbrt documented
signature
np.cbrt(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the cube-root of an array, element-wise.
cdoubleclassnp.cdouble documented
signature
np.cdouble: DType
Complex number type composed of two double-precision floating-point numbers, compatible with Python :class:complex.
ceilufuncnp.ceil documented
signature
np.ceil(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the ceiling of the input, element-wise.
choosefunctionnp.choose documented
signature
np.choose(a: ArrayLike, choices: NDArray | readonly Operand[], opts?: ChooseOptions | undefined): NDArray
Construct an array from an index array and a list of arrays to choose from.
clipfunctionnp.clip documented
signature
np.clip(a: ArrayLike, min?: Bound, max?: Bound, opts?: ClipOptions | undefined): NDArray
Clip (limit) the values in an array.
column_stackfunctionnp.columnStack documented
signature
np.columnStack(arrays: Sequence): NDArray
Stack 1-D arrays as columns into a 2-D array.
common_typefunctionnp.commonType documented
signature
np.commonType(...arrays: (NDArray | NestedArray)[]): DType
Return a scalar type which is common to the input arrays.
complex128classnp.complex128
signature
np.complex128: DType
Complex number type composed of two double-precision floating-point numbers, compatible with Python :class:complex.
complex64classnp.complex64
signature
np.complex64: DType
Complex number type composed of two single-precision floating-point numbers.
compressfunctionnp.compress documented
signature
np.compress(condition: ArrayLike, a: ArrayLike, axis?: number | AxisOptions | null | undefined): NDArray
Return selected slices of an array along given axis.
concatfunctionnp.concat
signature
np.concat(arrays: Sequence, axis?: number | ConcatenateOptions | null | undefined, options?: JoinOptions | undefined): NDArray
Join a sequence of arrays along an existing axis.
concatenatefunctionnp.concatenate documented
signature
np.concatenate(arrays: Sequence, axis?: number | ConcatenateOptions | null | undefined, options?: JoinOptions | undefined): NDArray
Join a sequence of arrays along an existing axis.
conjufuncnp.conj documented
signature
np.conj(a: ArrayLike): NDArray
Return the complex conjugate, element-wise.
conjugateufuncnp.conjugate documented
signature
np.conjugate(a: ArrayLike): NDArray
Return the complex conjugate, element-wise.
convolvefunctionnp.convolve documented
signature
np.convolve(a: ArrayLike, v: ArrayLike, mode?: ConvMode | undefined): NDArray
Returns the discrete, linear convolution of two one-dimensional sequences.
copyfunctionnp.copy documented
signature
np.copy(a: NDArray | NestedArray, options?: { order?: MemoryOrder | null | undefined; } | undefined): NDArray
Return an array copy of the given object.
copysignufuncnp.copysign documented
signature
np.copysign(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Change the sign of x1 to that of x2, element-wise.
copytofunctionnp.copyto documented
signature
np.copyto(dst: NDArray, src: number | bigint | boolean | NDArray | Complex | { readonly re: number; readonly im?: number | undefined; } | readonly NestedArray[], options?: CopytoOptions | undefined): void
Copies values from one array to another, broadcasting as necessary.
corrcoeffunctionnp.corrcoef documented
signature
np.corrcoef(x: ArrayLike, opts?: CorrcoefOptions | undefined): NDArray
Return Pearson product-moment correlation coefficients.
correlatefunctionnp.correlate documented
signature
np.correlate(a: ArrayLike, v: ArrayLike, mode?: ConvMode | undefined): NDArray
Cross-correlation of two 1-dimensional sequences.
cosufuncnp.cos documented
signature
np.cos(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Cosine element-wise.
coshufuncnp.cosh documented
signature
np.cosh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Hyperbolic cosine, element-wise.
count_nonzerofunctionnp.countNonzero documented
signature
np.countNonzero(a: ArrayLike, opts?: CountNonzeroOptions | undefined): NDArray
Counts the number of non-zero values in the array a.
covfunctionnp.cov documented
signature
np.cov(m: ArrayLike, opts?: CovOptions | undefined): NDArray
Estimate a covariance matrix, given data and weights.
crossfunctionnp.cross documented
signature
np.cross(a: ArrayLike, b: ArrayLike, opts?: CrossOptions | undefined): NDArray
Return the cross product of two (arrays of) vectors.
csingleclassnp.csingle documented
signature
np.csingle: DType
Complex number type composed of two single-precision floating-point numbers.
cumprodfunctionnp.cumprod documented
signature
np.cumprod(a: NDArray | NestedArray, axis?: number | null | undefined, opts?: { dtype?: DTypeLike | null | undefined; } | undefined): NDArray
Return the cumulative product of elements along a given axis.
cumsumfunctionnp.cumsum documented
signature
np.cumsum(a: NDArray | NestedArray, axis?: number | null | undefined, opts?: { dtype?: DTypeLike | null | undefined; } | undefined): NDArray
Return the cumulative sum of the elements along a given axis.
cumulative_prodfunctionnp.cumulativeProd documented
signature
np.cumulativeProd(x: ArrayLike, opts?: CumulativeOptions | undefined): NDArray
Return the cumulative product of elements along a given axis.
cumulative_sumfunctionnp.cumulativeSum documented
signature
np.cumulativeSum(x: ArrayLike, opts?: CumulativeOptions | undefined): NDArray
Return the cumulative sum of the elements along a given axis.
datetime_as_stringfunctionnp.datetime_as_string documented
signature
np.datetime_as_string(arr: DatetimeArray, options?: string | DatetimeAsStringOptions | undefined): string | string[]
Convert an array of datetimes into an array of strings.
datetime64classnp.datetime64 documented
signature
np.datetime64(value: DatetimeInput, unit?: string | undefined): DatetimeArray
If created from a 64-bit integer, it represents an offset from 1970-01-01T00:00:00. If created from string, the string can be in ISO 8601 date or datetime format.
deg2radufuncnp.deg2rad documented
signature
np.deg2rad(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Convert angles from degrees to radians.
degreesufuncnp.degrees documented
signature
np.degrees(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Convert angles from radians to degrees.
deletefunctionnp.delete documented
signature
np.delete(arr: ArrayLike, obj: EditIndex, axis?: number | null | undefined): NDArray
Return a new array with sub-arrays along an axis deleted. For a one dimensional array, this returns those entries not returned by arr[obj].
diagfunctionnp.diag documented
signature
np.diag(v: ArrayInput, k?: number | undefined): NDArray
Extract a diagonal or construct a diagonal array.
diag_indicesfunctionnp.diagIndices documented
signature
np.diagIndices(n: number, ndim?: number | undefined): NDArray[]
Return the indices to access the main diagonal of an array.
diag_indices_fromfunctionnp.diagIndicesFrom documented
signature
np.diagIndicesFrom(arr: NDArray): NDArray[]
Return the indices to access the main diagonal of an n-dimensional array.
diagflatfunctionnp.diagflat documented
signature
np.diagflat(v: ArrayInput, k?: number | undefined): NDArray
Create a two-dimensional array with the flattened input as a diagonal.
diagonalfunctionnp.diagonal documented
signature
np.diagonal(a: ArrayLike, opts?: number | DiagonalOptions | undefined): NDArray
Return specified diagonals.
difffunctionnp.diff documented
signature
np.diff(a: ArrayLike, n?: number | DiffOptions | undefined, axis?: number | undefined): NDArray
Calculate the n-th discrete difference along the given axis.
digitizefunctionnp.digitize documented
signature
np.digitize(x: ArrayLike, bins: ArrayLike, right?: boolean | undefined): NDArray
Return the indices of the bins to which each value in input array belongs.
divideufuncnp.divide documented
signature
np.divide(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Divide arguments element-wise.
divmodufuncnp.divmod documented
signature
np.divmod(a: Operand, b: Operand, opts?: MultiUfuncOptions | undefined): [NDArray, NDArray]
Return element-wise quotient and remainder simultaneously.
dotfunctionnp.dot documented
signature
np.dot(a: ArrayLike, b: ArrayLike): NDArray
Dot product of two arrays. Specifically,
doubleclassnp.double documented
signature
np.double: DType
Double-precision floating-point number type, compatible with Python :class:float and C double.
dsplitfunctionnp.dsplit
signature
np.dsplit(a: ArrayLike, indicesOrSections: number | NDArray | readonly number[]): NDArray[]
Split array into multiple sub-arrays along the 3rd axis (depth).
dstackfunctionnp.dstack documented
signature
np.dstack(arrays: Sequence): NDArray
Stack arrays in sequence depth wise (along third axis).
dtypeclassnp.dtype documented
signature
np.dtype(like: DTypeLike): DType
dtype(dtype, align=False, copy=False, **kwargs) --
econstantnp.e documented
signature
np.e: number
ediff1dfunctionnp.ediff1d documented
signature
np.ediff1d(a: ArrayLike, opts?: Ediff1dOptions | undefined): NDArray
The differences between consecutive elements of an array.
einsumfunctionnp.einsum documented
signature
np.einsum(subscripts: string, ...operands: (ArrayLike | EinsumOptions)[]): NDArray
np.einsum(...args: (ArrayLike | EinsumOptions | Sublist)[]): NDArray
Evaluates the Einstein summation convention on the operands.
einsum_pathfunctionnp.einsumPath documented
signature
np.einsumPath(subscripts: string, ...operands: (ArrayLike | EinsumOptions)[]): [EinsumPath, string]
np.einsumPath(...args: (ArrayLike | EinsumOptions | Sublist)[]): [EinsumPath, string]
Evaluates the lowest cost contraction order for an einsum expression by considering the creation of intermediate arrays.
emptyfunctionnp.empty documented
signature
np.empty(shape: number | Shape, options?: CreationOptions | undefined): NDArray
Return a new array of given shape and type, without initializing entries.
empty_likefunctionnp.emptyLike
signature
np.emptyLike(a: NDArray, options?: LikeOptions | undefined): NDArray
Return a new array with the same shape and type as a given array.
equalufuncnp.equal documented
signature
np.equal(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Return (x1 == x2) element-wise.
errstateclassnp.errstate documented
signature
np.errstate<T>(settings: ErrSettings, fn: () => T): T
Context manager for floating-point error handling.
euler_gammaconstantnp.euler_gamma documented
signature
np.euler_gamma: number
expufuncnp.exp documented
signature
np.exp(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Calculate the exponential of all elements in the input array.
exp2ufuncnp.exp2 documented
signature
np.exp2(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Calculate 2**p for all p in the input array.
expand_dimsfunctionnp.expandDims documented
signature
np.expandDims(a: NDArray, axis: number | readonly number[]): NDArray
Expand the shape of an array.
expm1ufuncnp.expm1 documented
signature
np.expm1(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Calculate exp(x) - 1 for all elements in the array.
extractfunctionnp.extract documented
signature
np.extract(condition: ArrayLike, arr: ArrayLike): NDArray
Return the elements of an array that satisfy some condition.
eyefunctionnp.eye documented
signature
np.eye(n: number, m?: number | undefined, options?: EyeOptions | undefined): NDArray
Return a 2-D array with ones on the diagonal and zeros elsewhere.
fabsufuncnp.fabs documented
signature
np.fabs(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Compute the absolute values element-wise.
False_constantnp.False_ documented
signature
np.False_: false
bool(value=False, /) --
fill_diagonalfunctionnp.fillDiagonal documented
signature
np.fillDiagonal(a: NDArray, val: ArrayInput, options?: { wrap?: boolean | undefined; } | undefined): void
Fill the main diagonal of the given array of any dimensionality.
finfoclassnp.finfo documented
signature
np.finfo(dt: NDArray | DTypeLike): FInfo
Machine limits for floating point types.
fixfunctionnp.fix documented
signature
np.fix(x: ArrayLike, opts?: RoundOptions | undefined): NDArray
Round to nearest integer towards zero.
flatnonzerofunctionnp.flatnonzero documented
signature
np.flatnonzero(a: ArrayLike): NDArray
Return indices that are non-zero in the flattened version of a.
flipfunctionnp.flip documented
signature
np.flip(m: ArrayLike, axis?: Axes | null | undefined): NDArray
Reverse the order of elements in an array along the given axis.
fliplrfunctionnp.fliplr
signature
np.fliplr(m: ArrayLike): NDArray
Reverse the order of elements along axis 1 (left/right).
flipudfunctionnp.flipud
signature
np.flipud(m: ArrayLike): NDArray
Reverse the order of elements along axis 0 (up/down).
float_powerufuncnp.floatPower documented
signature
np.floatPower(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
First array elements raised to powers from second array, element-wise.
float16classnp.float16
signature
np.float16: DType
Half-precision floating-point number type.
float32classnp.float32
signature
np.float32: DType
Single-precision floating-point number type, compatible with C float.
float64classnp.float64
signature
np.float64: DType
Double-precision floating-point number type, compatible with Python :class:float and C double.
floorufuncnp.floor documented
signature
np.floor(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the floor of the input, element-wise.
floor_divideufuncnp.floorDivide documented
signature
np.floorDivide(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Return the largest integer smaller or equal to the division of the inputs. It is equivalent to the Python // operator and pairs with the Python % (remainder), function so that a = a % b + b * (a // b) up to roundoff.
fmaxufuncnp.fmax documented
signature
np.fmax(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Element-wise maximum of array elements.
fminufuncnp.fmin documented
signature
np.fmin(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Element-wise minimum of array elements.
fmodufuncnp.fmod documented
signature
np.fmod(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Returns the element-wise remainder of division.
format_float_positionalfunctionnp.formatFloatPositional documented
signature
np.formatFloatPositional(x: number | boolean | NDArray, opts?: FormatFloatPositionalOptions | undefined): string
Format a floating-point scalar as a decimal string in positional notation.
format_float_scientificfunctionnp.formatFloatScientific documented
signature
np.formatFloatScientific(x: number | boolean | NDArray, opts?: FormatFloatScientificOptions | undefined): string
Format a floating-point scalar as a decimal string in scientific notation.
frexpufuncnp.frexp documented
signature
np.frexp(x: ArrayLike, opts?: MultiUfuncOptions | undefined): [NDArray, NDArray]
Decompose the elements of x into mantissa and twos exponent.
frombufferfunctionnp.frombuffer documented
signature
np.frombuffer(buffer: ArrayBufferLike | ArrayBufferView<ArrayBufferLike>, options?: FrombufferOptions | undefined): NDArray
Interpret a buffer as a 1-dimensional array.
fromfilefunctionnp.fromfile documented
signature
np.fromfile(file: string | URL | Uint8Array<ArrayBufferLike>, options?: FromfileOptions | undefined): NDArray
Construct an array from data in a text or binary file.
fromfunctionfunctionnp.fromfunction documented
signature
np.fromfunction<R>(fn: (...coords: NDArray[]) => R, shape: Shape, options?: { dtype?: DTypeLike | undefined; } | undefined): R
Construct an array by executing a function over each coordinate.
fromiterfunctionnp.fromiter documented
signature
np.fromiter(iterable: Iterable<number | bigint | boolean | ComplexLike>, dtype: DTypeLike, count?: number | undefined): NDArray
Create a new 1-dimensional array from an iterable object.
fromregexfunctionnp.fromregex documented
signature
np.fromregex(file: TextSource, regexp: string | RegExp, dtype: FieldList): Record<string, NDArray>
Construct an array from a text file, using regular expression parsing.
fromstringfunctionnp.fromstring documented
signature
np.fromstring(text: string, options?: FromstringOptions | undefined): NDArray
A new 1-D array initialized from text data in a string.
fullfunctionnp.full documented
signature
np.full(shape: number | Shape, fillValue: number | bigint | boolean | ComplexLike, options?: CreationOptions | undefined): NDArray
Return a new array of given shape and type, filled with fill_value.
full_likefunctionnp.fullLike
signature
np.fullLike(a: NDArray, fillValue: number | bigint | boolean | ComplexLike, options?: LikeOptions | undefined): NDArray
Return a full array with the same shape and type as a given array.
gcdufuncnp.gcd documented
signature
np.gcd(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Returns the greatest common divisor of |x1| and |x2|
genfromtxtfunctionnp.genfromtxt documented
signature
np.genfromtxt(fname: TextSource, options?: GenfromtxtOptions | undefined): NDArray
Load data from a text file, with missing values handled as specified.
geomspacefunctionnp.geomspace documented
signature
np.geomspace(start: ScalarLike, stop: ScalarLike, num?: number | undefined, options?: GeomspaceOptions | undefined): NDArray
Return numbers spaced evenly on a log scale (a geometric progression).
get_printoptionsfunctionnp.getPrintoptions documented
signature
np.getPrintoptions(): PrintOptions
Return the current print options.
geterrfunctionnp.geterr documented
signature
np.geterr(): ErrState
Get the current way of handling floating-point errors.
gradientfunctionnp.gradient documented
signature
np.gradient(f: ArrayLike, ...args: (Spacing | GradientOptions)[]): NDArray | NDArray[]
Return the gradient of an N-dimensional array.
greaterufuncnp.greater documented
signature
np.greater(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Return the truth value of (x1 > x2) element-wise.
greater_equalufuncnp.greaterEqual documented
signature
np.greaterEqual(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Return the truth value of (x1 >= x2) element-wise.
halfclassnp.half documented
signature
np.half: DType
Half-precision floating-point number type.
hammingfunctionnp.hamming documented
signature
np.hamming(M: number | bigint | NDArray): NDArray
Return the Hamming window.
hanningfunctionnp.hanning documented
signature
np.hanning(M: number | bigint | NDArray): NDArray
Return the Hanning window.
heavisideufuncnp.heaviside documented
signature
np.heaviside(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Compute the Heaviside step function.
histogramfunctionnp.histogram documented
signature
np.histogram(a: ArrayLike, bins?: BinsArg | undefined, opts?: HistogramOptions | undefined): HistogramResult
Compute the histogram of a dataset.
histogram_bin_edgesfunctionnp.histogramBinEdges documented
signature
np.histogramBinEdges(a: ArrayLike, bins?: BinsArg | undefined, opts?: HistogramOptions | undefined): NDArray
Function to calculate only the edges of the bins used by the histogram function.
histogram2dfunctionnp.histogram2d documented
signature
np.histogram2d(x: ArrayLike, y: ArrayLike, bins?: BinsArg | [BinsArg, BinsArg] | undefined, opts?: Omit<Histogram2dOptions, "bins"> | undefined): Histogram2dResult
Compute the bi-dimensional histogram of two data samples.
histogramddfunctionnp.histogramdd documented
signature
np.histogramdd(sample: ArrayLike, bins?: BinsArg | BinsArg[] | undefined, opts?: HistogramddOptions | undefined): HistogramddResult
Compute the multidimensional histogram of some data.
hsplitfunctionnp.hsplit
signature
np.hsplit(a: ArrayLike, indicesOrSections: number | NDArray | readonly number[]): NDArray[]
Split an array into multiple sub-arrays horizontally (column-wise).
hstackfunctionnp.hstack documented
signature
np.hstack(arrays: Sequence, options?: VHStackOptions | undefined): NDArray
Stack arrays in sequence horizontally (column wise).
hypotufuncnp.hypot documented
signature
np.hypot(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Given the "legs" of a right triangle, return its hypotenuse.
i0functionnp.i0 documented
signature
np.i0(x: ArrayLike): NDArray
Modified Bessel function of the first kind, order 0.
identityfunctionnp.identity documented
signature
np.identity(n: number, options?: ArrayOptions | undefined): NDArray
Return the identity array.
iinfoclassnp.iinfo documented
signature
np.iinfo(dt: NDArray | DTypeLike): IInfo
Machine limits for integer types.
imagfunctionnp.imag documented
signature
np.imag(a: ArrayLike): NDArray
Return the imaginary part of the complex argument.
index_expconstantnp.indexExp documented
signature
np.indexExp(...specs: (string | number | boolean | NDArray | readonly [] | readonly [number | null] | readonly [number | null, number | null] | readonly [number | null, number | null, number | null] | null)[]): IndexSpec[]
A nicer way to build up index tuples for arrays.
indicesfunctionnp.indices documented
signature
np.indices(dimensions: readonly number[], options: IndicesOptions & { sparse: true; }): NDArray[]
np.indices(dimensions: readonly number[], options?: IndicesOptions | undefined): NDArray
Return an array representing the indices of a grid.
infconstantnp.inf documented
signature
np.inf: number
innerfunctionnp.inner documented
signature
np.inner(a: ArrayLike, b: ArrayLike): NDArray
Inner product of two arrays.
insertfunctionnp.insert documented
signature
np.insert(arr: ArrayLike, obj: EditIndex, values: ArrayLike, axis?: number | null | undefined): NDArray
Insert values along the given axis before the given indices.
int_classnp.int_ documented
signature
np.int_: DType
Signed integer type, compatible with C long.
int16classnp.int16
signature
np.int16: DType
Signed integer type, compatible with C short.
int32classnp.int32
signature
np.int32: DType
Signed integer type, compatible with C int.
int64classnp.int64
signature
np.int64: DType
Signed integer type, compatible with C long.
int8classnp.int8
signature
np.int8: DType
Signed integer type, compatible with C char.
intcclassnp.intc documented
signature
np.intc: DType
Signed integer type, compatible with C int.
interpfunctionnp.interp documented
signature
np.interp(x: ArrayLike, xp: ArrayLike, fp: ArrayLike, opts?: InterpOptions | undefined): NDArray
One-dimensional linear interpolation for monotonically increasing sample points.
intersect1dfunctionnp.intersect1d documented
signature
np.intersect1d(a: ArrayLike, b: ArrayLike, opts?: { assumeUnique?: boolean | undefined; returnIndices?: false | undefined; } | undefined): NDArray
np.intersect1d(a: ArrayLike, b: ArrayLike, opts: { assumeUnique?: boolean | undefined; returnIndices: true; }): IntersectResult
Find the intersection of two arrays.
intpclassnp.intp documented
signature
np.intp: DType
Signed integer type, compatible with C long.
invertufuncnp.invert documented
signature
np.invert(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Compute bit-wise inversion, or bit-wise NOT, element-wise.
is_busdayfunctionnp.is_busday documented
signature
np.is_busday(dates: string | number | bigint | DatetimeArray | (string | number | bigint | DatetimeArray)[], options?: IsBusdayOptions | undefined): boolean | boolean[]
Calculates which of the given dates are valid days, and which are not.
isclosefunctionnp.isclose documented
signature
np.isclose(a: CloseOperand, b: CloseOperand, opts?: IscloseOptions | undefined): NDArray
Returns a boolean array where two arrays are element-wise equal within a tolerance.
iscomplexfunctionnp.iscomplex documented
signature
np.iscomplex(a: ArrayLike): NDArray
Returns a bool array, where True if input element is complex.
iscomplexobjfunctionnp.iscomplexobj documented
signature
np.iscomplexobj(a: ArrayLike): boolean
Check for a complex type or an array of complex numbers.
isdtypefunctionnp.isdtype documented
signature
np.isdtype(dt: DType, kind: string | DType | readonly (string | DType)[]): boolean
Determine if a provided dtype is of a specified data type kind.
isfiniteufuncnp.isfinite documented
signature
np.isfinite(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Test element-wise for finiteness (not infinity and not Not a Number).
isfortranfunctionnp.isfortran documented
signature
np.isfortran(a: NDArray): boolean
Check if the array is Fortran contiguous but not C contiguous.
isinfunctionnp.isin documented
signature
np.isin(element: ArrayLike, testElements: ArrayLike, opts?: IsinOptions | undefined): NDArray
Calculates element in test_elements, broadcasting over element only. Returns a boolean array of the same shape as element that is True where an element of element is in test_elements and False otherwise.
isinfufuncnp.isinf documented
signature
np.isinf(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Test element-wise for positive or negative infinity.
isnanufuncnp.isnan documented
signature
np.isnan(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Test element-wise for NaN and return result as a boolean array.
isnatufuncnp.isnat documented
signature
np.isnat(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Test element-wise for NaT (not a time) and return result as a boolean array.
isneginffunctionnp.isneginf documented
signature
np.isneginf(x: ArrayLike, opts?: { out?: NDArray | null | undefined; } | undefined): NDArray
Test element-wise for negative infinity, return result as bool array.
isposinffunctionnp.isposinf documented
signature
np.isposinf(x: ArrayLike, opts?: { out?: NDArray | null | undefined; } | undefined): NDArray
Test element-wise for positive infinity, return result as bool array.
isrealfunctionnp.isreal documented
signature
np.isreal(a: ArrayLike): NDArray
Returns a bool array, where True if input element is real.
isrealobjfunctionnp.isrealobj documented
signature
np.isrealobj(a: ArrayLike): boolean
Return True if x is a not complex type or an array of complex numbers.
isscalarfunctionnp.isscalar documented
signature
np.isscalar(x: unknown): boolean
Returns True if the type of element is a scalar type.
issubdtypefunctionnp.issubdtype documented
signature
np.issubdtype(a: DTypeLike | AbstractDType, b: DTypeLike | AbstractDType): boolean
Returns True if first argument is a typecode lower/equal in type hierarchy.
ix_functionnp.ix_ documented
signature
np.ix_(...seqs: ArrayInput[]): NDArray[]
Construct an open mesh from multiple sequences.
kaiserfunctionnp.kaiser documented
signature
np.kaiser(M: number | bigint | NDArray, beta: number | NDArray): NDArray
Return the Kaiser window.
kronfunctionnp.kron documented
signature
np.kron(a: ArrayLike, b: ArrayLike): NDArray
Kronecker product of two arrays.
lcmufuncnp.lcm documented
signature
np.lcm(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Returns the lowest common multiple of |x1| and |x2|
ldexpufuncnp.ldexp documented
signature
np.ldexp(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Returns x1 * 2**x2, element-wise.
left_shiftufuncnp.leftShift documented
signature
np.leftShift(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Shift the bits of an integer to the left.
lessufuncnp.less documented
signature
np.less(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Return the truth value of (x1 < x2) element-wise.
less_equalufuncnp.lessEqual documented
signature
np.lessEqual(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Return the truth value of (x1 <= x2) element-wise.
lexsortfunctionnp.lexsort documented
signature
np.lexsort(keys: NDArray | readonly ArrayLike[], opts?: { axis?: number | null | undefined; } | undefined): NDArray
Perform an indirect stable sort using a sequence of keys.
linspacefunctionnp.linspace documented
signature
np.linspace(start: number, stop: number, num?: number | undefined, options?: LinspaceOptions | undefined): NDArray
Return evenly spaced numbers over a specified interval.
loadfunctionnp.load documented
signature
np.load(file: string | URL | BytesLike, options?: LoadOptions | undefined): NDArray | NpzFile
Load arrays or pickled objects from .npy, .npz or pickled files.
loadtxtfunctionnp.loadtxt documented
signature
np.loadtxt(fname: TextSource, options?: LoadtxtOptions | undefined): NDArray
Load data from a text file.
logufuncnp.log documented
signature
np.log(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Natural logarithm, element-wise.
log10ufuncnp.log10 documented
signature
np.log10(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the base 10 logarithm of the input array, element-wise.
log1pufuncnp.log1p documented
signature
np.log1p(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the natural logarithm of one plus the input array, element-wise.
log2ufuncnp.log2 documented
signature
np.log2(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Base-2 logarithm of x.
logaddexpufuncnp.logaddexp documented
signature
np.logaddexp(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Logarithm of the sum of exponentiations of the inputs.
logaddexp2ufuncnp.logaddexp2 documented
signature
np.logaddexp2(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Logarithm of the sum of exponentiations of the inputs in base-2.
logical_andufuncnp.logicalAnd documented
signature
np.logicalAnd(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Compute the truth value of x1 AND x2 element-wise.
logical_notufuncnp.logicalNot documented
signature
np.logicalNot(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Compute the truth value of NOT x element-wise.
logical_orufuncnp.logicalOr documented
signature
np.logicalOr(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Compute the truth value of x1 OR x2 element-wise.
logical_xorufuncnp.logicalXor documented
signature
np.logicalXor(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Compute the truth value of x1 XOR x2, element-wise.
logspacefunctionnp.logspace documented
signature
np.logspace(start: ScalarLike, stop: ScalarLike, num?: number | undefined, options?: LogspaceOptions | undefined): NDArray
Return numbers spaced evenly on a log scale.
longclassnp.long
signature
np.long: DType
Signed integer type, compatible with C long.
mask_indicesfunctionnp.maskIndices documented
signature
np.maskIndices(n: number, maskFunc: (m: NDArray, k: number) => NDArray, k?: number | undefined): NDArray[]
Return the indices to access (n, n) arrays, given a masking function.
matmulufuncnp.matmul documented
signature
np.matmul(a: ArrayLike, b: ArrayLike): NDArray
Matrix product of two arrays.
matrix_transposefunctionnp.matrixTranspose
signature
np.matrixTranspose(x: ArrayLike): NDArray
Transposes a matrix (or a stack of matrices) x.
matvecufuncnp.matvec documented
signature
np.matvec(x1: ArrayLike, x2: ArrayLike): NDArray
Matrix-vector dot product of two arrays.
maxfunctionnp.max documented
signature
np.max(a: ArrayLike, opts?: Omit<ReduceOptions, "dtype"> | undefined): NDArray
Return the maximum of an array or maximum along an axis.
maximumufuncnp.maximum documented
signature
np.maximum(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Element-wise maximum of array elements.
may_share_memoryfunctionnp.mayShareMemory documented
signature
np.mayShareMemory(a: NDArray, b: NDArray): boolean
Determine if two arrays might share memory
meanfunctionnp.mean documented
signature
np.mean(a: ArrayLike, opts?: Omit<ReduceOptions, "initial"> | undefined): NDArray
Compute the arithmetic mean along the specified axis.
medianfunctionnp.median documented
signature
np.median(a: ArrayLike, opts?: MedianOptions | undefined): NDArray
Compute the median along the specified axis.
meshgridfunctionnp.meshgrid documented
signature
np.meshgrid(...args: (ArrayInput | MeshgridOptions)[]): NDArray[]
Return a tuple of coordinate matrices from coordinate vectors.
mgridconstantnp.mgrid documented
signature
np.mgrid(...slices: GridSlice[]): NDArray
An instance which returns a dense multi-dimensional "meshgrid".
minfunctionnp.min documented
signature
np.min(a: ArrayLike, opts?: Omit<ReduceOptions, "dtype"> | undefined): NDArray
Return the minimum of an array or minimum along an axis.
min_scalar_typefunctionnp.minScalarType documented
signature
np.minScalarType(a: NDArray | JSScalar): DType
For scalar a, returns the data type with the smallest size and smallest scalar kind which can hold its value. For non-scalar array a, returns the vector's dtype unmodified.
minimumufuncnp.minimum documented
signature
np.minimum(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Element-wise minimum of array elements.
mintypecodefunctionnp.mintypecode documented
signature
np.mintypecode(typechars: string | readonly (string | NDArray | NestedArray | DType)[], typeset?: string | undefined, defaultCode?: string | undefined): string
Return the character for the minimum-size type to which given types can be safely cast.
modufuncnp.mod documented
signature
np.mod(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Returns the element-wise remainder of division.
modfufuncnp.modf documented
signature
np.modf(x: ArrayLike, opts?: MultiUfuncOptions | undefined): [NDArray, NDArray]
Return the fractional and integral parts of an array, element-wise.
moveaxisfunctionnp.moveAxis documented
signature
np.moveAxis(a: NDArray, source: number | readonly number[], destination: number | readonly number[]): NDArray
Move axes of an array to new positions.
multiplyufuncnp.multiply documented
signature
np.multiply(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Multiply arguments element-wise.
nanconstantnp.nan documented
signature
np.nan: number
nan_to_numfunctionnp.nanToNum documented
signature
np.nanToNum(x: ArrayLike, opts?: NanToNumOptions | undefined): NDArray
Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the numbers defined by the user using the nan, posinf and/or neginf keywords.
nanargmaxfunctionnp.nanargmax documented
signature
np.nanargmax(a: ArrayLike, opts?: ArgReduceOptions | undefined): NDArray
Return the indices of the maximum values in the specified axis ignoring NaNs. For all-NaN slices ValueError is raised. Warning: the results cannot be trusted if a slice contains only NaNs and -Infs.
nanargminfunctionnp.nanargmin documented
signature
np.nanargmin(a: ArrayLike, opts?: ArgReduceOptions | undefined): NDArray
Return the indices of the minimum values in the specified axis ignoring NaNs. For all-NaN slices ValueError is raised. Warning: the results cannot be trusted if a slice contains only NaNs and Infs.
nancumprodfunctionnp.nancumprod documented
signature
np.nancumprod(a: ArrayLike, opts?: CumsumOptions | undefined): NDArray
Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one. The cumulative product does not change when NaNs are encountered and leading NaNs are replaced by ones.
nancumsumfunctionnp.nancumsum documented
signature
np.nancumsum(a: ArrayLike, opts?: CumsumOptions | undefined): NDArray
Return the cumulative sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. The cumulative sum does not change when NaNs are encountered and leading NaNs are replaced by zeros.
nanmaxfunctionnp.nanmax documented
signature
np.nanmax(a: ArrayLike, opts?: Omit<ReduceOptions, "dtype"> | undefined): NDArray
Return the maximum of an array or maximum along an axis, ignoring any NaNs. When all-NaN slices are encountered a RuntimeWarning is raised and NaN is returned for that slice.
nanmeanfunctionnp.nanmean documented
signature
np.nanmean(a: ArrayLike, opts?: Omit<ReduceOptions, "initial"> | undefined): NDArray
Compute the arithmetic mean along the specified axis, ignoring NaNs.
nanmedianfunctionnp.nanmedian documented
signature
np.nanmedian(a: ArrayLike, opts?: MedianOptions | undefined): NDArray
Compute the median along the specified axis, while ignoring NaNs.
nanminfunctionnp.nanmin documented
signature
np.nanmin(a: ArrayLike, opts?: Omit<ReduceOptions, "dtype"> | undefined): NDArray
Return minimum of an array or minimum along an axis, ignoring any NaNs. When all-NaN slices are encountered a RuntimeWarning is raised and Nan is returned for that slice.
nanpercentilefunctionnp.nanpercentile documented
signature
np.nanpercentile(a: ArrayLike, q: ArrayLike, opts?: QuantileOptions | undefined): NDArray
Compute the qth percentile of the data along the specified axis, while ignoring nan values.
nanprodfunctionnp.nanprod documented
signature
np.nanprod(a: ArrayLike, opts?: ReduceOptions | undefined): NDArray
Return the product of array elements over a given axis treating Not a Numbers (NaNs) as ones.
nanquantilefunctionnp.nanquantile documented
signature
np.nanquantile(a: ArrayLike, q: ArrayLike, opts?: QuantileOptions | undefined): NDArray
Compute the qth quantile of the data along the specified axis, while ignoring nan values. Returns the qth quantile(s) of the array elements.
nanstdfunctionnp.nanstd documented
signature
np.nanstd(a: ArrayLike, opts?: VarOptions | undefined): NDArray
Compute the standard deviation along the specified axis, while ignoring NaNs.
nansumfunctionnp.nansum documented
signature
np.nansum(a: ArrayLike, opts?: ReduceOptions | undefined): NDArray
Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero.
nanvarfunctionnp.nanvar documented
signature
np.nanvar(a: ArrayLike, opts?: VarOptions | undefined): NDArray
Compute the variance along the specified axis, while ignoring NaNs.
ndarrayclassnp.NDArray
signature
new np.NDArray(token: typeof internal, handle: NativeNDArray)
An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is an integer, a floating point number, or something else, etc.)
ndenumerateclassnp.ndenumerate documented
signature
np.ndenumerate(a: Operand): Generator<[number[], ScalarValue], any, any>
Multidimensional index iterator.
ndimfunctionnp.ndim documented
signature
np.ndim(a: ArrayLike): number
Return the number of dimensions of an array.
ndindexclassnp.ndindex documented
signature
np.ndindex(...shape: (number | readonly number[])[]): Generator<number[], any, any>
An N-dimensional iterator object to index arrays.
negativeufuncnp.negative documented
signature
np.negative(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Numerical negation, element-wise.
newaxisconstantnp.newaxis
signature
np.newaxis: "newaxis"
nextafterufuncnp.nextafter documented
signature
np.nextafter(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Return the next floating-point value after x1 towards x2, element-wise.
nonzerofunctionnp.nonzero documented
signature
np.nonzero(a: NDArray | NestedArray): NDArray[]
Return the indices of the elements that are non-zero.
not_equalufuncnp.notEqual documented
signature
np.notEqual(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Return (x1 != x2) element-wise.
ogridconstantnp.ogrid documented
signature
np.ogrid(slice: GridSlice): NDArray
np.ogrid(...slices: GridSlice[]): NDArray[]
An instance which returns an open multi-dimensional "meshgrid".
onesfunctionnp.ones documented
signature
np.ones(shape: number | Shape, options?: CreationOptions | undefined): NDArray
Return a new array of given shape and type, filled with ones.
ones_likefunctionnp.onesLike
signature
np.onesLike(a: NDArray, options?: LikeOptions | undefined): NDArray
Return an array of ones with the same shape and type as a given array.
outerfunctionnp.outer documented
signature
np.outer(a: ArrayLike, b: ArrayLike): NDArray
Compute the outer product of two vectors.
packbitsfunctionnp.packbits documented
signature
np.packbits(a: ArrayLike, opts?: PackbitsOptions | undefined): NDArray
Packs the elements of a binary-valued array into bits in a uint8 array.
padfunctionnp.pad documented
signature
np.pad(a: ArrayLike, padWidth: PadWidth, mode?: PadMode | PadFunction | undefined, options?: (PadOptions & Record<string, unknown>) | undefined): NDArray
Pad an array.
partitionfunctionnp.partition documented
signature
np.partition(a: ArrayLike, kth: Kth, opts?: PartitionOptions | undefined): NDArray
Return a partitioned copy of an array.
percentilefunctionnp.percentile documented
signature
np.percentile(a: ArrayLike, q: ArrayLike, opts?: QuantileOptions | undefined): NDArray
Compute the q-th percentile of the data along the specified axis.
permute_dimsfunctionnp.permuteDims
signature
np.permuteDims(a: ArrayLike, axes?: readonly number[] | undefined): NDArray
Returns an array with axes transposed.
piconstantnp.pi documented
signature
np.pi: number
piecewisefunctionnp.piecewise documented
signature
np.piecewise(x: ArrayLike, condlist: ArrayLike | readonly ArrayLike[], funclist: readonly PiecewiseFunc[]): NDArray
Evaluate a piecewise-defined function.
placefunctionnp.place documented
signature
np.place(arr: NDArray, mask: ArrayLike, vals: ArrayLike): void
Change elements of an array based on conditional and input values.
polyfunctionnp.poly documented
signature
np.poly(seqOfZeros: ArrayLike): number | NDArray
Find the coefficients of a polynomial with the given sequence of roots.
poly1dclassnp.poly1d documented
signature
new np.poly1d(cOrR: PolyLike, options?: boolean | Poly1dOptions | undefined)
A one-dimensional polynomial class.
polyaddfunctionnp.polyadd documented
signature
np.polyadd(a1: poly1d, a2: PolyLike): poly1d
np.polyadd(a1: PolyLike, a2: poly1d): poly1d
np.polyadd(a1: ArrayLike, a2: ArrayLike): NDArray
Find the sum of two polynomials.
polyderfunctionnp.polyder documented
signature
np.polyder(p: poly1d, m?: number | undefined): poly1d
np.polyder(p: ArrayLike, m?: number | undefined): NDArray
Return the derivative of the specified order of a polynomial.
polydivfunctionnp.polydiv documented
signature
np.polydiv(u: poly1d, v: PolyLike): [poly1d, poly1d]
np.polydiv(u: PolyLike, v: poly1d): [poly1d, poly1d]
np.polydiv(u: ArrayLike, v: ArrayLike): [NDArray, NDArray]
Returns the quotient and remainder of polynomial division.
polyfitfunctionnp.polyfit documented
signature
np.polyfit(x: ArrayLike, y: ArrayLike, deg: number, options?: PolyfitOptions | undefined): NDArray | (number | NDArray)[]
Least squares polynomial fit.
polyintfunctionnp.polyint documented
signature
np.polyint(p: poly1d, m?: number | undefined, k?: ArrayLike | null | undefined): poly1d
np.polyint(p: ArrayLike, m?: number | undefined, k?: ArrayLike | null | undefined): NDArray
Return an antiderivative (indefinite integral) of a polynomial.
polymulfunctionnp.polymul documented
signature
np.polymul(a1: poly1d, a2: PolyLike): poly1d
np.polymul(a1: PolyLike, a2: poly1d): poly1d
np.polymul(a1: ArrayLike, a2: ArrayLike): NDArray
Find the product of two polynomials.
polysubfunctionnp.polysub documented
signature
np.polysub(a1: poly1d, a2: PolyLike): poly1d
np.polysub(a1: PolyLike, a2: poly1d): poly1d
np.polysub(a1: ArrayLike, a2: ArrayLike): NDArray
Difference (subtraction) of two polynomials.
polyvalfunctionnp.polyval documented
signature
np.polyval(p: PolyLike, x: poly1d): poly1d
np.polyval(p: PolyLike, x: ArrayLike): NDArray
Evaluate a polynomial at specific values.
positiveufuncnp.positive documented
signature
np.positive(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Numerical positive, element-wise.
powufuncnp.pow documented
signature
np.pow(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
First array elements raised to powers from second array, element-wise.
powerufuncnp.power documented
signature
np.power(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
First array elements raised to powers from second array, element-wise.
printoptionsfunctionnp.printoptions documented
signature
np.printoptions<T>(opts: PrintOptionsInput, fn: () => T): T
Context manager for setting print options.
prodfunctionnp.prod documented
signature
np.prod(a: ArrayLike, opts?: ReduceOptions | undefined): NDArray
Return the product of array elements over a given axis.
promote_typesfunctionnp.promoteTypes documented
signature
np.promoteTypes(a: DTypeLike, b: DTypeLike): DType
Returns the data type with the smallest size and smallest scalar kind to which both type1 and type2 may be safely cast. The returned data type is always considered "canonical", this mainly means that the promoted dtype will always be in native byte order.
putfunctionnp.put documented
signature
np.put(a: NDArray, ind: ArrayLike, v: ArrayLike, opts?: PutOptions | undefined): void
Replaces specified elements of an array with given values.
put_along_axisfunctionnp.putAlongAxis documented
signature
np.putAlongAxis(arr: NDArray, indices: ArrayLike, values: ArrayLike, axis: number | null): void
Put values into the destination array by matching 1d index and data slices.
putmaskfunctionnp.putmask documented
signature
np.putmask(a: NDArray, mask: ArrayLike, values: ArrayLike): void
Changes elements of an array based on conditional and input values.
quantilefunctionnp.quantile documented
signature
np.quantile(a: ArrayLike, q: ArrayLike, opts?: QuantileOptions | undefined): NDArray
Compute the q-th quantile of the data along the specified axis.
r_constantnp.r_ documented
signature
np.r_(...items: ConcatItem[]): NDArray
Translates slice objects to concatenation along the first axis.
rad2degufuncnp.rad2deg documented
signature
np.rad2deg(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Convert angles from radians to degrees.
radiansufuncnp.radians documented
signature
np.radians(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Convert angles from degrees to radians.
ravelfunctionnp.ravel documented
signature
np.ravel(a: NDArray, opts?: OrderOptions | undefined): NDArray
Return a contiguous flattened array.
ravel_multi_indexfunctionnp.ravelMultiIndex documented
signature
np.ravelMultiIndex(multiIndex: readonly ArrayLike[], dims: number | Shape, opts?: RavelMultiIndexOptions | undefined): NDArray
Converts a tuple of index arrays into an array of flat indices, applying boundary modes to the multi-index.
realfunctionnp.real documented
signature
np.real(a: ArrayLike): NDArray
Return the real part of the complex argument.
real_if_closefunctionnp.realIfClose documented
signature
np.realIfClose(x: ArrayLike, tol?: number | undefined): NDArray
If input is complex with all imaginary parts close to zero, return real parts.
recarrayclassnp.recarray documented
signature
new np.recarray(shape: number | number[], opts?: RecArrayOptions | undefined)
Construct an ndarray that allows field access using attributes.
reciprocalufuncnp.reciprocal documented
signature
np.reciprocal(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the reciprocal of the argument, element-wise.
remainderufuncnp.remainder documented
signature
np.remainder(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Returns the element-wise remainder of division.
repeatfunctionnp.repeat documented
signature
np.repeat(a: ArrayLike, repeats: IntList, axis?: number | null | undefined): NDArray
Repeat each element of an array after themselves
requirefunctionnp.require documented
signature
np.require(a: ArrayLike, dtype?: DTypeLike | null | undefined, requirements?: Requirements | null | undefined): NDArray
Return an ndarray of the provided type that satisfies requirements.
reshapefunctionnp.reshape documented
signature
np.reshape(a: NDArray, shape: number | Shape, opts?: OrderOptions | undefined): NDArray
Returns a reshaped ndarray without changing data.
resizefunctionnp.resize documented
signature
np.resize(a: ArrayLike, newShape: number | readonly number[]): NDArray
Return a new array with the specified shape.
result_typefunctionnp.resultType documented
signature
np.resultType(...args: (NDArray | NestedArray | DTypeLike)[]): DType
Returns the type that results from applying the NumPy :ref:type promotion <arrays.promotion> rules to the arguments.
right_shiftufuncnp.rightShift documented
signature
np.rightShift(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Shift the bits of an integer to the right.
rintufuncnp.rint documented
signature
np.rint(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Round elements of the array to the nearest integer.
rollfunctionnp.roll documented
signature
np.roll(a: ArrayLike, shift: Axes, axis?: Axes | null | undefined): NDArray
Roll array elements along a given axis.
rollaxisfunctionnp.rollaxis documented
signature
np.rollaxis(a: ArrayLike, axis: number, start?: number | undefined): NDArray
Roll the specified axis backwards, until it lies in a given position.
rootsfunctionnp.roots documented
signature
np.roots(p: PolyLike): NDArray
Return the roots of a polynomial with coefficients given in p.
rot90functionnp.rot90 documented
signature
np.rot90(m: ArrayLike, k?: number | undefined, axes?: readonly number[] | undefined): NDArray
Rotate an array by 90 degrees in the plane specified by axes.
roundfunctionnp.round documented
signature
np.round(a: ArrayLike, decimals?: number | undefined, opts?: RoundOptions | undefined): NDArray
Evenly round to the given number of decimals.
s_constantnp.s_ documented
signature
np.s_(spec: string | number | boolean | NDArray | readonly [] | readonly [number | null] | readonly [number | null, number | null] | readonly [number | null, number | null, number | null] | null): IndexSpec
np.s_(...specs: (string | number | boolean | NDArray | readonly [] | readonly [number | null] | readonly [number | null, number | null] | readonly [number | null, number | null, number | null] | null)[]): IndexSpec[]
A nicer way to build up index tuples for arrays.
savefunctionnp.save documented
signature
np.save(file: FileLike, arr: ArrayLike): any
Save an array to a binary file in NumPy .npy format.
savetxtfunctionnp.savetxt documented
signature
np.savetxt(fname: string | URL | null, X: ArrayLike, options?: SavetxtOptions | undefined): string | undefined
Save an array to a text file.
savezfunctionnp.savez documented
signature
np.savez(file: FileLike, ...arrays: (ArrayLike | NamedArrays)[]): any
Save several arrays into a single file in uncompressed .npz format.
savez_compressedfunctionnp.savezCompressed documented
signature
np.savezCompressed(file: FileLike, ...arrays: (ArrayLike | NamedArrays)[]): any
Save several arrays into a single file in compressed .npz format.
searchsortedfunctionnp.searchsorted documented
signature
np.searchsorted(a: ArrayLike, v: number | bigint | boolean | NDArray | Complex | { readonly re: number; readonly im?: number | undefined; } | readonly NestedArray[], opts?: SearchsortedOptions | undefined): NDArray
Find indices where elements should be inserted to maintain order.
selectfunctionnp.select documented
signature
np.select(condlist: readonly ArrayLike[], choicelist: readonly ArrayLike[], opts?: SelectOptions | undefined): NDArray
Return an array drawn from elements in choicelist, depending on conditions.
set_printoptionsfunctionnp.setPrintoptions documented
signature
np.setPrintoptions(opts?: PrintOptionsInput | undefined): void
Set printing options.
setdiff1dfunctionnp.setdiff1d documented
signature
np.setdiff1d(a: ArrayLike, b: ArrayLike, opts?: { assumeUnique?: boolean | undefined; } | undefined): NDArray
Find the set difference of two arrays.
seterrfunctionnp.seterr documented
signature
np.seterr(settings?: ErrSettings | undefined): ErrState
Set how floating-point errors are handled.
setxor1dfunctionnp.setxor1d documented
signature
np.setxor1d(a: ArrayLike, b: ArrayLike, opts?: { assumeUnique?: boolean | undefined; } | undefined): NDArray
Find the set exclusive-or of two arrays.
shapefunctionnp.shape documented
signature
np.shape(a: ArrayLike): number[]
Return the shape of an array.
shares_memoryfunctionnp.sharesMemory documented
signature
np.sharesMemory(a: NDArray, b: NDArray, _opts?: SharesMemoryOptions | undefined): boolean
Determine if two arrays share memory.
shortclassnp.short documented
signature
np.short: DType
Signed integer type, compatible with C short.
signufuncnp.sign documented
signature
np.sign(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Returns an element-wise indication of the sign of a number.
signbitufuncnp.signbit documented
signature
np.signbit(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Returns element-wise True where signbit is set (less than zero).
sinufuncnp.sin documented
signature
np.sin(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Trigonometric sine, element-wise.
sincfunctionnp.sinc documented
signature
np.sinc(x: ArrayLike): NDArray
Return the normalized sinc function.
singleclassnp.single documented
signature
np.single: DType
Single-precision floating-point number type, compatible with C float.
sinhufuncnp.sinh documented
signature
np.sinh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Hyperbolic sine, element-wise.
sizefunctionnp.size documented
signature
np.size(a: ArrayLike, axis?: number | readonly number[] | null | undefined): number
Return the number of elements along a given axis.
sortfunctionnp.sort documented
signature
np.sort(a: ArrayLike, opts?: SortOptions | undefined): NDArray
Return a sorted copy of an array.
sort_complexfunctionnp.sortComplex documented
signature
np.sortComplex(a: ArrayLike): NDArray
Sort a complex array using the real part first, then the imaginary part.
spacingufuncnp.spacing documented
signature
np.spacing(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the distance between x and the nearest adjacent number.
splitfunctionnp.split documented
signature
np.split(a: ArrayLike, indicesOrSections: number | NDArray | readonly number[], axis?: number | undefined): NDArray[]
Split an array into multiple sub-arrays as views into ary.
sqrtufuncnp.sqrt documented
signature
np.sqrt(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the non-negative square-root of an array, element-wise.
squareufuncnp.square documented
signature
np.square(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the element-wise square of the input.
squeezefunctionnp.squeeze documented
signature
np.squeeze(a: NDArray, axis?: number | readonly number[] | undefined): NDArray
Remove axes of length one from a.
stackfunctionnp.stack documented
signature
np.stack(arrays: Sequence, axis?: number | StackOptions | undefined, options?: JoinOptions | undefined): NDArray
Join a sequence of arrays along a new axis.
stdfunctionnp.std documented
signature
np.std(a: ArrayLike, opts?: VarOptions | undefined): NDArray
Compute the standard deviation along the specified axis.
str_classnp.str_ documented
signature
np.str_: "str"
A unicode string.
subtractufuncnp.subtract documented
signature
np.subtract(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Subtract arguments, element-wise.
sumfunctionnp.sum documented
signature
np.sum(a: ArrayLike, opts?: ReduceOptions | undefined): NDArray
Sum of array elements over a given axis.
swapaxesfunctionnp.swapAxes documented
signature
np.swapAxes(a: NDArray, axis1: number, axis2: number): NDArray
Interchange two axes of an array.
takefunctionnp.take documented
signature
np.take(a: NDArray | NestedArray, indices: NDArray | NestedArray, axis?: number | TakeOptions | null | undefined, opts?: TakeOptions | undefined): NDArray
Take elements from an array along an axis.
take_along_axisfunctionnp.takeAlongAxis documented
signature
np.takeAlongAxis(arr: ArrayLike, indices: ArrayLike, axis?: number | null | undefined): NDArray
Take values from the input array by matching 1d index and data slices.
tanufuncnp.tan documented
signature
np.tan(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Compute tangent element-wise.
tanhufuncnp.tanh documented
signature
np.tanh(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Hyperbolic tangent, element-wise.
tensordotfunctionnp.tensordot documented
signature
np.tensordot(a: ArrayLike, b: ArrayLike, opts?: TensordotOptions | undefined): NDArray
Compute tensor dot product along specified axes.
tilefunctionnp.tile documented
signature
np.tile(a: ArrayLike, reps: IntList): NDArray
Construct an array by repeating A the number of times given by reps.
timedelta64classnp.timedelta64 documented
signature
np.timedelta64(value: TimedeltaInput, unit?: string | undefined): TimedeltaArray
A timedelta stored as a 64-bit integer.
tracefunctionnp.trace documented
signature
np.trace(a: ArrayLike, opts?: number | TraceOptions | undefined): NDArray
Return the sum along diagonals of the array.
transposefunctionnp.transpose documented
signature
np.transpose(a: NDArray, axes?: readonly number[] | undefined): NDArray
Returns an array with axes transposed.
trapezoidfunctionnp.trapezoid documented
signature
np.trapezoid(y: ArrayLike, opts?: TrapezoidOptions | undefined): NDArray
Integrate along the given axis using the composite trapezoidal rule.
trifunctionnp.tri documented
signature
np.tri(n: number, m?: number | null | undefined, options?: TriOptions | undefined): NDArray
An array with ones at and below the given diagonal and zeros elsewhere.
trilfunctionnp.tril documented
signature
np.tril(m: ArrayInput, k?: number | undefined): NDArray
Lower triangle of an array.
tril_indicesfunctionnp.trilIndices documented
signature
np.trilIndices(n: number, k?: number | undefined, m?: number | null | undefined): NDArray[]
Return the indices for the lower-triangle of an (n, m) array.
tril_indices_fromfunctionnp.trilIndicesFrom documented
signature
np.trilIndicesFrom(arr: NDArray, k?: number | undefined): NDArray[]
Return the indices for the lower-triangle of arr.
trim_zerosfunctionnp.trimZeros documented
signature
np.trimZeros(filt: ArrayLike, trim?: string | undefined, axis?: number | readonly number[] | null | undefined): NDArray
Remove values along a dimension which are zero along all other.
triufunctionnp.triu documented
signature
np.triu(m: ArrayInput, k?: number | undefined): NDArray
Upper triangle of an array.
triu_indicesfunctionnp.triuIndices documented
signature
np.triuIndices(n: number, k?: number | undefined, m?: number | null | undefined): NDArray[]
Return the indices for the upper-triangle of an (n, m) array.
triu_indices_fromfunctionnp.triuIndicesFrom documented
signature
np.triuIndicesFrom(arr: NDArray, k?: number | undefined): NDArray[]
Return the indices for the upper-triangle of arr.
True_constantnp.True_ documented
signature
np.True_: true
bool(value=False, /) --
true_divideufuncnp.trueDivide documented
signature
np.trueDivide(a: Operand, b: Operand, opts?: UfuncOptions | undefined): NDArray
Divide arguments element-wise.
truncufuncnp.trunc documented
signature
np.trunc(a: ArrayLike, opts?: UfuncOptions | undefined): NDArray
Return the truncated value of the input, element-wise.
ubyteclassnp.ubyte documented
signature
np.ubyte: DType
Unsigned integer type, compatible with C unsigned char.
uintclassnp.uint documented
signature
np.uint: DType
Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit systems.
uint16classnp.uint16
signature
np.uint16: DType
Unsigned integer type, compatible with C unsigned short.
uint32classnp.uint32
signature
np.uint32: DType
Unsigned integer type, compatible with C unsigned int.
uint64classnp.uint64
signature
np.uint64: DType
Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit systems.
uint8classnp.uint8
signature
np.uint8: DType
Unsigned integer type, compatible with C unsigned char.
uintcclassnp.uintc documented
signature
np.uintc: DType
Unsigned integer type, compatible with C unsigned int.
uintpclassnp.uintp documented
signature
np.uintp: DType
Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit systems.
ulongclassnp.ulong documented
signature
np.ulong: DType
Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit systems.
union1dfunctionnp.union1d documented
signature
np.union1d(a: ArrayLike, b: ArrayLike): NDArray
Find the union of two arrays.
uniquefunctionnp.unique documented
signature
np.unique(a: ArrayLike, opts?: (UniqueOptions & { returnIndex?: false | undefined; returnInverse?: false | undefined; returnCounts?: false | undefined; }) | undefined): NDArray
np.unique(a: ArrayLike, opts: UniqueOptions): UniqueResult
Find the unique elements of an array.
unique_allfunctionnp.uniqueAll documented
signature
np.uniqueAll(x: ArrayLike): UniqueAllResult
Find the unique elements of an array, and counts, inverse, and indices.
unique_countsfunctionnp.uniqueCounts
signature
np.uniqueCounts(x: ArrayLike): UniqueCountsResult
Find the unique elements and counts of an input array x.
unique_inversefunctionnp.uniqueInverse
signature
np.uniqueInverse(x: ArrayLike): UniqueInverseResult
Find the unique elements of x and indices to reconstruct x.
unique_valuesfunctionnp.uniqueValues
signature
np.uniqueValues(x: ArrayLike): NDArray
Returns the unique elements of an input array x.
unpackbitsfunctionnp.unpackbits documented
signature
np.unpackbits(a: ArrayLike, opts?: UnpackbitsOptions | undefined): NDArray
Unpacks elements of a uint8 array into a binary-valued output array.
unravel_indexfunctionnp.unravelIndex documented
signature
np.unravelIndex(indices: ArrayLike, shape: number | Shape, opts?: { order?: MemoryOrder | undefined; } | undefined): NDArray[]
Converts a flat index or array of flat indices into a tuple of coordinate arrays.
unstackfunctionnp.unstack documented
signature
np.unstack(x: ArrayLike, axis?: number | { axis?: number | undefined; } | undefined): NDArray[]
Split an array into a sequence of arrays along the given axis.
unwrapfunctionnp.unwrap documented
signature
np.unwrap(p: ArrayLike, opts?: UnwrapOptions | undefined): NDArray
Unwrap by taking the complement of large deltas with respect to the period.
ushortclassnp.ushort documented
signature
np.ushort: DType
Unsigned integer type, compatible with C unsigned short.
vanderfunctionnp.vander documented
signature
np.vander(x: ArrayInput, n?: number | null | undefined, options?: { increasing?: boolean | undefined; } | undefined): NDArray
Generate a Vandermonde matrix.
varfunctionnp.var documented
signature
np.var(a: ArrayLike, opts?: VarOptions | undefined): NDArray
Compute the variance along the specified axis.
vdotfunctionnp.vdot documented
signature
np.vdot(a: ArrayLike, b: ArrayLike): NDArray
Return the dot product of two vectors.
vecdotufuncnp.vecdot documented
signature
np.vecdot(x1: ArrayLike, x2: ArrayLike, opts?: VecdotOptions | undefined): NDArray
Vector dot product of two arrays.
vecmatufuncnp.vecmat documented
signature
np.vecmat(x1: ArrayLike, x2: ArrayLike): NDArray
Vector-matrix dot product of two arrays.
vectorizeclassnp.vectorize documented
signature
np.vectorize(fn: (...args: unknown[]) => unknown, opts?: VectorizeOptions | undefined): VectorizedFn
Returns an object that acts like pyfunc, but takes arrays as input.
vsplitfunctionnp.vsplit
signature
np.vsplit(a: ArrayLike, indicesOrSections: number | NDArray | readonly number[]): NDArray[]
Split an array into multiple sub-arrays vertically (row-wise).
vstackfunctionnp.vstack documented
signature
np.vstack(arrays: Sequence, options?: VHStackOptions | undefined): NDArray
Stack arrays in sequence vertically (row wise).
wherefunctionnp.where documented
signature
np.where(condition: NDArray | NestedArray): NDArray[]
np.where(condition: NDArray | NestedArray, x: NDArray | NestedArray, y: NDArray | NestedArray): NDArray
Return elements chosen from x or y depending on condition.
zerosfunctionnp.zeros documented
signature
np.zeros(shape: number | Shape, options?: CreationOptions | undefined): NDArray
Return a new array of given shape and type, filled with zeros.
zeros_likefunctionnp.zerosLike documented
signature
np.zerosLike(a: NDArray, options?: LikeOptions | undefined): NDArray
Return an array of zeros with the same shape and type as a given array.

numpy.polynomial# 6 / 6

NumPynumeraSummary
Chebyshevclassnp.polynomial.chebyshev documented
signature
np.polynomial.chebyshev: Record<string, unknown>
A Chebyshev series class.
Hermiteclassnp.polynomial.hermite
signature
np.polynomial.hermite: Record<string, unknown>
A Hermite series class.
HermiteEclassnp.polynomial.hermite_e
signature
np.polynomial.hermite_e: Record<string, unknown>
A HermiteE series class.
Laguerreclassnp.polynomial.laguerre
signature
np.polynomial.laguerre: Record<string, unknown>
A Laguerre series class.
Legendreclassnp.polynomial.legendre
signature
np.polynomial.legendre: Record<string, unknown>
A Legendre series class.
Polynomialclassnp.polynomial.polynomial
signature
np.polynomial.polynomial: Record<string, unknown>
A power series class.

numpy.random# 59 / 60

NumPynumeraSummary
betafunctionnp.random.beta
signature
np.random.beta(a: number, b: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Beta distribution.
binomialfunctionnp.random.binomial
signature
np.random.binomial(n: number, p: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a binomial distribution.
BitGeneratorclassnp.random.BitGenerator documented
signature
new np.random.BitGenerator()
Base Class for generic BitGenerators, which provide a stream of random bits based on different algorithms. Must be overridden.
bytesfunctionnp.random.bytes
signature
np.random.bytes(length: number): Uint8Array<ArrayBufferLike>
Return random bytes.
chisquarefunctionnp.random.chisquare
signature
np.random.chisquare(df: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a chi-square distribution.
choicefunctionnp.random.choice
signature
np.random.choice(a: NDArray | NestedArray, size?: Size | { size?: Size | undefined; replace?: boolean | undefined; p?: unknown; } | null | undefined, replace?: boolean | undefined, p?: unknown): number | boolean | NDArray | Complex
Generates a random sample from a given 1-D array
default_rngfunctionnp.random.defaultRng documented
signature
np.random.defaultRng(seed?: Seed | Generator | null | undefined): Generator
Construct a new Generator with the default BitGenerator (PCG64).
dirichletfunctionnp.random.dirichlet
signature
np.random.dirichlet(alpha: readonly number[], size?: Size | null | undefined): NDArray
Draw samples from the Dirichlet distribution.
exponentialfunctionnp.random.exponential
signature
np.random.exponential(scale?: number | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from an exponential distribution.
ffunctionnp.random.f
signature
np.random.f(dfnum: number, dfden: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from an F distribution.
gammafunctionnp.random.gamma
signature
np.random.gamma(shape: number, scale?: number | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Gamma distribution.
Generatorclassnp.random.Generator
signature
new np.random.Generator(bg: BitGenerator | NativeBitGenerator)
Container for the BitGenerators.
geometricfunctionnp.random.geometric
signature
np.random.geometric(p: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from the geometric distribution.
get_statefunctionnp.random.get_state documented
signature
np.random.get_state(): bigint[]
Return a tuple representing the internal state of the generator.
gumbelfunctionnp.random.gumbel
signature
np.random.gumbel(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Gumbel distribution.
hypergeometricfunctionnp.random.hypergeometric
signature
np.random.hypergeometric(ngood: number, nbad: number, nsample: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Hypergeometric distribution.
laplacefunctionnp.random.laplace
signature
np.random.laplace(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from the Laplace or double exponential distribution with specified location (or mean) and scale (decay).
logisticfunctionnp.random.logistic
signature
np.random.logistic(loc?: number | undefined, scale?: number | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a logistic distribution.
lognormalfunctionnp.random.lognormal
signature
np.random.lognormal(mean?: number | undefined, sigma?: number | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a log-normal distribution.
logseriesfunctionnp.random.logseries
signature
np.random.logseries(p: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a logarithmic series distribution.
MT19937classnp.random.MT19937
signature
new np.random.MT19937(seed?: SeedLike | SeedSequence | null | undefined)
Container for the Mersenne Twister pseudo-random number generator.
multinomialfunctionnp.random.multinomial
signature
np.random.multinomial(n: number, pvals: readonly number[], size?: Size | null | undefined): NDArray
Draw samples from a multinomial distribution.
multivariate_normalfunctionnot implementedDraw random samples from a multivariate normal distribution.
negative_binomialfunctionnp.random.negative_binomial
signature
np.random.negative_binomial(n: number, p: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a negative binomial distribution.
noncentral_chisquarefunctionnp.random.noncentral_chisquare
signature
np.random.noncentral_chisquare(df: number, nonc: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a noncentral chi-square distribution.
noncentral_ffunctionnp.random.noncentral_f
signature
np.random.noncentral_f(dfnum: number, dfden: number, nonc: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from the noncentral F distribution.
normalfunctionnp.random.normal
signature
np.random.normal(loc?: number | { loc?: number | undefined; scale?: number | undefined; size?: Size | undefined; } | undefined, scale?: number | undefined, size?: Size | undefined): number | boolean | NDArray | Complex
Draw random samples from a normal (Gaussian) distribution.
paretofunctionnp.random.pareto
signature
np.random.pareto(a: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Pareto II or Lomax distribution with specified shape.
PCG64classnp.random.PCG64
signature
new np.random.PCG64(seed?: SeedLike | SeedSequence | null | undefined)
BitGenerator for the PCG-64 pseudo-random number generator.
PCG64DXSMclassnp.random.PCG64DXSM documented
signature
new np.random.PCG64DXSM(seed?: SeedLike | SeedSequence | null | undefined)
BitGenerator for the PCG-64 DXSM pseudo-random number generator.
permutationfunctionnp.random.permutation
signature
np.random.permutation(x: NDArray | NestedArray): NDArray
Randomly permute a sequence, or return a permuted range.
Philoxclassnp.random.Philox documented
signature
new np.random.Philox(seed?: SeedLike | SeedSequence | null | undefined)
Container for the Philox (4x64) pseudo-random number generator.
poissonfunctionnp.random.poisson
signature
np.random.poisson(lam?: number | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Poisson distribution.
powerfunctionnp.random.power
signature
np.random.power(a: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draws samples in [0, 1] from a power distribution with positive exponent a - 1.
randfunctionnp.random.rand
signature
np.random.rand(...dims: number[]): number | boolean | NDArray | Complex
Random values in a given shape.
randintfunctionnp.random.randint
signature
np.random.randint(low: number | bigint | { low: number | bigint; high?: number | bigint | null | undefined; size?: Size | undefined; dtype?: DTypeLike | undefined; }, high?: number | bigint | null | undefined, size?: Size | undefined, dt?: DTypeLike | undefined): number | boolean | NDArray | Complex
Return random integers from low (inclusive) to high (exclusive).
randnfunctionnp.random.randn
signature
np.random.randn(...dims: number[]): number | boolean | NDArray | Complex
Return a sample (or samples) from the "standard normal" distribution.
randomfunctionnp.random.random
signature
np.random.random(size?: Size | null | undefined): number | boolean | NDArray | Complex
Return random floats in the half-open interval [0.0, 1.0). Alias for random_sample to ease forward-porting to the new random API.
random_integersfunctionnp.random.random_integers documented
signature
np.random.random_integers(low: number, high?: number | null | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Random integers of type numpy.int_ between low and high, inclusive.
random_samplefunctionnp.random.randomSample
signature
np.random.randomSample(size?: Size | null | undefined): number | boolean | NDArray | Complex
Return random floats in the half-open interval [0.0, 1.0).
RandomStateclassnp.random.RandomState
signature
new np.random.RandomState(seed?: Seed | null | undefined)
Container for the slow Mersenne Twister pseudo-random number generator. Consider using a different BitGenerator with the Generator container instead.
ranffunctionnp.random.ranf documented
signature
np.random.ranf(size?: Size | null | undefined): number | boolean | NDArray | Complex
This is an alias of random_sample. See random_sample for the complete documentation.
rayleighfunctionnp.random.rayleigh
signature
np.random.rayleigh(scale?: number | undefined, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Rayleigh distribution.
samplefunctionnp.random.sample documented
signature
np.random.sample(size?: Size | null | undefined): number | boolean | NDArray | Complex
This is an alias of random_sample. See random_sample for the complete documentation.
seedfunctionnp.random.seed documented
signature
np.random.seed(seed?: Seed | null | undefined): void
Reseed the singleton RandomState instance.
SeedSequenceclassnp.random.SeedSequence documented
signature
new np.random.SeedSequence(entropy?: SeedLike | null | undefined, options?: SeedSequenceOptions | undefined)
SeedSequence mixes sources of entropy in a reproducible way to set the initial state for independent and very probably non-overlapping BitGenerators.
set_statefunctionnp.random.set_state documented
signature
np.random.set_state(words: bigint[]): void
Set the internal state of the generator from a tuple.
SFC64classnp.random.SFC64 documented
signature
new np.random.SFC64(seed?: SeedLike | SeedSequence | null | undefined)
BitGenerator for Chris Doty-Humphrey's Small Fast Chaotic PRNG.
shufflefunctionnp.random.shuffle
signature
np.random.shuffle(x: NDArray): void
Modify a sequence in-place by shuffling its contents.
standard_cauchyfunctionnp.random.standard_cauchy
signature
np.random.standard_cauchy(size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a standard Cauchy distribution with mode = 0.
standard_exponentialfunctionnp.random.standard_exponential
signature
np.random.standard_exponential(size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from the standard exponential distribution.
standard_gammafunctionnp.random.standard_gamma
signature
np.random.standard_gamma(shape: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a standard Gamma distribution.
standard_normalfunctionnp.random.standardNormal
signature
np.random.standardNormal(size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a standard Normal distribution (mean=0, stdev=1).
standard_tfunctionnp.random.standard_t
signature
np.random.standard_t(df: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a standard Student's t distribution with df degrees of freedom.
triangularfunctionnp.random.triangular
signature
np.random.triangular(left: number, mode: number, right: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from the triangular distribution over the interval [left, right].
uniformfunctionnp.random.uniform
signature
np.random.uniform(low?: number | { low?: number | undefined; high?: number | undefined; size?: Size | undefined; } | undefined, high?: number | undefined, size?: Size | undefined): number | boolean | NDArray | Complex
Draw samples from a uniform distribution.
vonmisesfunctionnp.random.vonmises
signature
np.random.vonmises(mu: number, kappa: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a von Mises distribution.
waldfunctionnp.random.wald
signature
np.random.wald(mean: number, scale: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Wald, or inverse Gaussian, distribution.
weibullfunctionnp.random.weibull
signature
np.random.weibull(a: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Weibull distribution.
zipffunctionnp.random.zipf
signature
np.random.zipf(a: number, size?: Size | null | undefined): number | boolean | NDArray | Complex
Draw samples from a Zipf distribution.

numpy.rec# 7 / 7

NumPynumeraSummary
arrayfunctionnp.rec.array documented
signature
np.rec.array(obj: recarray | ArrayLike[] | unknown[][], opts?: RecArrayOptions | undefined): recarray
Construct a record array from a wide-variety of objects.
find_duplicatefunctionnp.rec.find_duplicate documented
signature
np.rec.find_duplicate(list: unknown[]): unknown[]
Find duplication in a list, return a list of duplicated elements
format_parserclassnp.rec.format_parser
signature
new np.rec.format_parser(formats: string | string[], names?: string | string[] | null | undefined, _titles?: unknown, _aligned?: boolean | undefined, _byteorder?: string | null | undefined)
Class to convert formats, names, titles description to a dtype.
fromarraysfunctionnp.rec.fromarrays documented
signature
np.rec.fromarrays(arrayList: ArrayLike[], opts?: RecArrayOptions | undefined): recarray
Create a record array from a (flat) list of arrays
fromrecordsfunctionnp.rec.fromrecords documented
signature
np.rec.fromrecords(recList: ArrayLike | unknown[][], opts?: RecArrayOptions | undefined): recarray
Create a recarray from a list of records in text form.
recarrayclassnp.rec.recarray documented
signature
new np.rec.recarray(shape: number | number[], opts?: RecArrayOptions | undefined)
Construct an ndarray that allows field access using attributes.
recordclassnp.rec.record
signature
new np.rec.record(shape: number | number[], opts?: RecArrayOptions | undefined)
A data-type scalar that allows field access as attribute lookup.

numpy.strings# 46 / 46

NumPynumeraSummary
addufuncnp.strings.add documented
signature
np.strings.add(a: StringLike, b: StringLike): StringArray
Add arguments element-wise.
capitalizefunctionnp.strings.capitalize documented
signature
np.strings.capitalize(a: StringLike): StringArray
Return a copy of a with only the first character of each element capitalized.
centerfunctionnp.strings.center
signature
np.strings.center(a: StringLike, width: number, fillchar?: string | undefined): StringArray
Return a copy of a with its elements centered in a string of length width.
countfunctionnp.strings.count
signature
np.strings.count(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Returns an array with the number of non-overlapping occurrences of substring sub in the range [start, end).
decodefunctionnp.strings.decode
signature
np.strings.decode(a: StringLike, encoding?: string | undefined, _errors?: string | undefined): StringArray
Calls :meth:bytes.decode element-wise.
encodefunctionnp.strings.encode
signature
np.strings.encode(a: StringLike, encoding?: string | undefined, _errors?: string | undefined): StringArray
Calls :meth:str.encode element-wise.
endswithfunctionnp.strings.endswith
signature
np.strings.endswith(a: StringLike, suffix: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Returns a boolean array which is True where the string element in a ends with suffix, otherwise False.
equalufuncnp.strings.equal documented
signature
np.strings.equal(a: StringLike, b: StringLike): NDArray
Return (x1 == x2) element-wise.
expandtabsfunctionnp.strings.expandtabs
signature
np.strings.expandtabs(a: StringLike, tabsize?: number | undefined): StringArray
Return a copy of each string element where all tab characters are replaced by one or more spaces.
findfunctionnp.strings.find
signature
np.strings.find(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
For each element, return the lowest index in the string where substring sub is found, such that sub is contained in the range [start, end).
greaterufuncnp.strings.greater
signature
np.strings.greater(a: StringLike, b: StringLike): NDArray
Return the truth value of (x1 > x2) element-wise.
greater_equalufuncnp.strings.greater_equal
signature
np.strings.greater_equal(a: StringLike, b: StringLike): NDArray
Return the truth value of (x1 >= x2) element-wise.
indexfunctionnp.strings.index
signature
np.strings.index(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Like find, but raises :exc:ValueError when the substring is not found.
isalnumufuncnp.strings.isalnum
signature
np.strings.isalnum(a: StringLike): NDArray
Returns true for each element if all characters in the string are alphanumeric and there is at least one character, false otherwise.
isalphaufuncnp.strings.isalpha
signature
np.strings.isalpha(a: StringLike): NDArray
Returns true for each element if all characters in the data interpreted as a string are alphabetic and there is at least one character, false otherwise.
isdecimalufuncnp.strings.isdecimal
signature
np.strings.isdecimal(a: StringLike): NDArray
For each element, return True if there are only decimal characters in the element.
isdigitufuncnp.strings.isdigit
signature
np.strings.isdigit(a: StringLike): NDArray
Returns true for each element if all characters in the string are digits and there is at least one character, false otherwise.
islowerufuncnp.strings.islower
signature
np.strings.islower(a: StringLike): NDArray
Returns true for each element if all cased characters in the string are lowercase and there is at least one cased character, false otherwise.
isnumericufuncnp.strings.isnumeric
signature
np.strings.isnumeric(a: StringLike): NDArray
For each element, return True if there are only numeric characters in the element.
isspaceufuncnp.strings.isspace
signature
np.strings.isspace(a: StringLike): NDArray
Returns true for each element if there are only whitespace characters in the string and there is at least one character, false otherwise.
istitleufuncnp.strings.istitle
signature
np.strings.istitle(a: StringLike): NDArray
Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise.
isupperufuncnp.strings.isupper
signature
np.strings.isupper(a: StringLike): NDArray
Return true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise.
lessufuncnp.strings.less
signature
np.strings.less(a: StringLike, b: StringLike): NDArray
Return the truth value of (x1 < x2) element-wise.
less_equalufuncnp.strings.less_equal
signature
np.strings.less_equal(a: StringLike, b: StringLike): NDArray
Return the truth value of (x1 <= x2) element-wise.
ljustfunctionnp.strings.ljust
signature
np.strings.ljust(a: StringLike, width: number, fillchar?: string | undefined): StringArray
Return an array with the elements of a left-justified in a string of length width.
lowerfunctionnp.strings.lower documented
signature
np.strings.lower(a: StringLike): StringArray
Return an array with the elements converted to lowercase.
lstripfunctionnp.strings.lstrip
signature
np.strings.lstrip(a: StringLike, chars?: string | null | undefined): StringArray
For each element in a, return a copy with the leading characters removed.
modfunctionnp.strings.mod
signature
np.strings.mod(a: StringLike, values: unknown): StringArray
Return (a % i), that is pre-Python 2.6 string formatting (interpolation), element-wise for a pair of array_likes of str or unicode.
multiplyfunctionnp.strings.multiply documented
signature
np.strings.multiply(a: StringLike, i: number | NDArray): StringArray
Return (a * i), that is string multiple concatenation, element-wise.
not_equalufuncnp.strings.not_equal
signature
np.strings.not_equal(a: StringLike, b: StringLike): NDArray
Return (x1 != x2) element-wise.
partitionfunctionnp.strings.partition
signature
np.strings.partition(a: StringLike, sep: StringLike): StringArray[]
Partition each element in a around sep.
replacefunctionnp.strings.replace
signature
np.strings.replace(a: StringLike, old_: StringLike, new_: StringLike, count_?: number | undefined): StringArray
For each element in a, return a copy of the string with occurrences of substring old replaced by new.
rfindfunctionnp.strings.rfind
signature
np.strings.rfind(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
For each element, return the highest index in the string where substring sub is found, such that sub is contained in the range [start, end).
rindexfunctionnp.strings.rindex
signature
np.strings.rindex(a: StringLike, sub: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Like rfind, but raises :exc:ValueError when the substring sub is not found.
rjustfunctionnp.strings.rjust
signature
np.strings.rjust(a: StringLike, width: number, fillchar?: string | undefined): StringArray
Return an array with the elements of a right-justified in a string of length width.
rpartitionfunctionnp.strings.rpartition
signature
np.strings.rpartition(a: StringLike, sep: StringLike): StringArray[]
Partition (split) each element around the right-most separator.
rstripfunctionnp.strings.rstrip
signature
np.strings.rstrip(a: StringLike, chars?: string | null | undefined): StringArray
For each element in a, return a copy with the trailing characters removed.
slicefunctionnp.strings.slice
signature
np.strings.slice(a: StringLike, start?: number | undefined, stop?: number | undefined, step?: number | undefined): StringArray
Slice the strings in a by slices specified by start, stop, step. Like in the regular Python slice object, if only start is specified then it is interpreted as the stop.
startswithfunctionnp.strings.startswith
signature
np.strings.startswith(a: StringLike, prefix: StringLike, start?: number | undefined, end?: number | undefined): NDArray
Returns a boolean array which is True where the string element in a starts with prefix, otherwise False.
str_lenufuncnp.strings.str_len documented
signature
np.strings.str_len(a: StringLike): NDArray
Returns the length of each element. For byte strings, this is the number of bytes, while, for Unicode strings, it is the number of Unicode code points.
stripfunctionnp.strings.strip
signature
np.strings.strip(a: StringLike, chars?: string | null | undefined): StringArray
For each element in a, return a copy with the leading and trailing characters removed.
swapcasefunctionnp.strings.swapcase
signature
np.strings.swapcase(a: StringLike): StringArray
Return element-wise a copy of the string with uppercase characters converted to lowercase and vice versa.
titlefunctionnp.strings.title
signature
np.strings.title(a: StringLike): StringArray
Return element-wise title cased version of string or unicode.
translatefunctionnp.strings.translate
signature
np.strings.translate(a: StringLike, table: Map<string, string | null>): StringArray
For each element in a, return a copy of the string where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table.
upperfunctionnp.strings.upper documented
signature
np.strings.upper(a: StringLike): StringArray
Return an array with the elements converted to uppercase.
zfillfunctionnp.strings.zfill
signature
np.strings.zfill(a: StringLike, width: number): StringArray
Return the numeric string left-filled with zeros. A leading sign prefix (+/-) is handled by inserting the padding after the sign character rather than before.

numpy.testing# 14 / 14

NumPynumeraSummary
assert_functionnp.testing.assert_
signature
np.testing.assert_(val: unknown, msg?: string | (() => string) | undefined): void
Assert that works in release mode. Accepts callable msg to allow deferring evaluation until failure.
assert_allclosefunctionnp.testing.assertAllclose documented
signature
np.testing.assertAllclose(actual: ArrayLike, desired: ArrayLike, opts?: AllcloseOptions | undefined): void
Raises an AssertionError if two objects are not equal up to desired tolerance.
assert_almost_equalfunctionnp.testing.assertAlmostEqual
signature
np.testing.assertAlmostEqual(actual: Operand, desired: Operand, opts?: AlmostEqualOptions | undefined): void
Raises an AssertionError if two items are not equal up to desired precision.
assert_approx_equalfunctionnp.testing.assertApproxEqual
signature
np.testing.assertApproxEqual(actual: number, desired: number, opts?: ApproxEqualOptions | undefined): void
Raises an AssertionError if two items are not equal up to significant digits.
assert_array_almost_equalfunctionnp.testing.assertArrayAlmostEqual
signature
np.testing.assertArrayAlmostEqual(actual: ArrayLike, desired: ArrayLike, opts?: AlmostEqualOptions | undefined): void
Raises an AssertionError if two objects are not equal up to desired precision.
assert_array_almost_equal_nulpfunctionnp.testing.assertArrayAlmostEqualNulp
signature
np.testing.assertArrayAlmostEqualNulp(x: ArrayLike, y: ArrayLike, nulp?: number | undefined): void
Compare two arrays relatively to their spacing.
assert_array_comparefunctionnp.testing.assertArrayCompare
signature
np.testing.assertArrayCompare(comparison: (x: NDArray, y: NDArray) => boolean | NDArray, actual: ArrayLike, desired: ArrayLike, opts?: AssertArrayCompareOptions | undefined): void
assert_array_equalfunctionnp.testing.assertArrayEqual documented
signature
np.testing.assertArrayEqual(actual: ArrayLike, desired: ArrayLike, opts?: AssertOptions | undefined): void
Raises an AssertionError if two array_like objects are not equal.
assert_array_lessfunctionnp.testing.assertArrayLess
signature
np.testing.assertArrayLess(x: ArrayLike, y: ArrayLike, opts?: AssertOptions | undefined): void
Raises an AssertionError if two array_like objects are not ordered by less than.
assert_array_max_ulpfunctionnp.testing.assertArrayMaxUlp documented
signature
np.testing.assertArrayMaxUlp(a: ArrayLike, b: ArrayLike, opts?: MaxUlpOptions | undefined): NDArray
Check that all items of arrays differ in at most N Units in the Last Place.
assert_equalfunctionnp.testing.assertEqual documented
signature
np.testing.assertEqual(actual: unknown, desired: unknown, opts?: AssertOptions | undefined): void
Raises an AssertionError if two objects are not equal.
assert_raisesfunctionnp.testing.assertRaises documented
signature
np.testing.assertRaises<A extends unknown[]>(errorClass: ErrorCtor, fn: (...args: A) => unknown, ...args: A): Error
Fail unless an exception of class exception_class is thrown by callable when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
assert_raises_regexfunctionnp.testing.assertRaisesRegex
signature
np.testing.assertRaisesRegex<A extends unknown[]>(errorClass: ErrorCtor, pattern: string | RegExp, fn: (...args: A) => unknown, ...args: A): Error
Fail unless an exception of class exception_class and with message that matches expected_regexp is thrown by callable when invoked with arguments args and keyword arguments kwargs.
assert_string_equalfunctionnp.testing.assertStringEqual documented
signature
np.testing.assertStringEqual(actual: string, desired: string): void
Test if two strings are equal.