deeptrack.extras.radialcenter Module#

Radial center calculation function

This module provides a function to calculate the center location of an intensity distribution.

Module Structure#

Functions: - radialcenter: Calculates the center of a 2D intensity distribution.

Example#

Calculate center of an image containing randomly generated Gaussian blur.

>>> from deeptrack.extras import radialcenter as rc
>>> gaussian_blur = np.random.normal(0, 0.005, (100, 100))
>>> x, y = rc.radialcenter(gaussian_blur)
>>> print(f"Center of distribution = {x}, {y}")

Python implementation by Benjamin Midtvedt, University of Gothenburg, 2020 Copyright 2011-2012, Raghuveer Parthasarathy, The University of Oregon

Disclaimer / License
This program is free software: you can redistribute it and/or

modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This set of programs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License (gpl.txt) along with this program.

Raghuveer Parthasarathy The University of Oregon August 21, 2011 (begun) last modified Apr. 6, 2012 (minor change) Copyright 2011-2012, Raghuveer Parthasarathy

Functions#

all(a[, axis, out, keepdims, where])

Test whether all array elements along a given axis evaluate to True.

allclose(a, b[, rtol, atol, equal_nan])

Returns True if two arrays are element-wise equal within a tolerance.

amax(a[, axis, out, keepdims, initial, where])

Return the maximum of an array or maximum along an axis.

amin(a[, axis, out, keepdims, initial, where])

Return the minimum of an array or minimum along an axis.

angle(z[, deg])

Return the angle of the complex argument.

any(a[, axis, out, keepdims, where])

Test whether any array element along a given axis evaluates to True.

append(arr, values[, axis])

Append values to the end of an array.

apply_along_axis(func1d, axis, arr, *args, ...)

Apply a function to 1-D slices along the given axis.

apply_over_axes(func, a, axes)

Apply a function repeatedly over multiple axes.

arange([start,] stop[, step,][, dtype, ...])

Return evenly spaced values within a given interval.

argmax(a[, axis, out, keepdims])

Returns the indices of the maximum values along an axis.

argmin(a[, axis, out, keepdims])

Returns the indices of the minimum values along an axis.

argpartition(a, kth[, axis, kind, order])

Perform an indirect partition along the given axis using the algorithm specified by the kind keyword.

argsort(a[, axis, kind, order, stable])

Returns the indices that would sort an array.

argwhere(a)

Find the indices of array elements that are non-zero, grouped by element.

around(a[, decimals, out])

Round an array to the given number of decimals.

array

array(object, dtype=None, *, copy=True, order='K', subok=False, ndmin=0,

array2string(a[, max_line_width, precision, ...])

Return a string representation of an array.

array_equal(a1, a2[, equal_nan])

True if two arrays have the same shape and elements, False otherwise.

array_equiv(a1, a2)

Returns True if input arrays are shape consistent and all elements equal.

array_repr(arr[, max_line_width, precision, ...])

Return the string representation of an array.

array_split(ary, indices_or_sections[, axis])

Split an array into multiple sub-arrays.

array_str(a[, max_line_width, precision, ...])

Return a string representation of the data in an array.

asanyarray(a[, dtype, order, like])

Convert the input to an ndarray, but pass ndarray subclasses through.

asarray(a[, dtype, order, device, copy, like])

Convert the input to an array.

asarray_chkfinite(a[, dtype, order])

Convert the input to an array, checking for NaNs or Infs.

ascontiguousarray(a[, dtype, like])

Return a contiguous array (ndim >= 1) in memory (C order).

asfortranarray(a[, dtype, like])

Return an array (ndim >= 1) laid out in Fortran order in memory.

asmatrix(data[, dtype])

Interpret the input as a matrix.

astype(x, dtype, /, *[, copy])

Copies an array to a specified data type.

atleast_1d(*arys)

Convert inputs to arrays with at least one dimension.

atleast_2d(*arys)

View inputs as arrays with at least two dimensions.

atleast_3d(*arys)

View inputs as arrays with at least three dimensions.

average(a[, axis, weights, returned, keepdims])

Compute the weighted average along the specified axis.

bartlett(M)

Return the Bartlett window.

base_repr(number[, base, padding])

Return a string representation of a number in the given base system.

binary_repr(num[, width])

Return the binary representation of the input number as a string.

bincount(x, /[, weights, minlength])

Count number of occurrences of each value in array of non-negative ints.

blackman(M)

Return the Blackman window.

block(arrays)

Assemble an nd-array from nested lists of blocks.

bmat(obj[, ldict, gdict])

Build a matrix object from a string, nested sequence, or array.

broadcast_arrays(*args[, subok])

Broadcast any number of arrays against each other.

broadcast_shapes(*args)

Broadcast the input shapes into a single shape.

broadcast_to(array, shape[, subok])

Broadcast an array to a new shape.

busday_count

busday_count(

busday_offset

busday_offset(

can_cast(from_, to[, casting])

Returns True if cast between data types can occur according to the casting rule.

choose(a, choices[, out, mode])

Construct an array from an index array and a list of arrays to choose from.

clip(a, a_min, a_max[, out])

Clip (limit) the values in an array.

column_stack(tup)

Stack 1-D arrays as columns into a 2-D array.

common_type(*arrays)

Return a scalar type which is common to the input arrays.

compress(condition, a[, axis, out])

Return selected slices of an array along given axis.

concat

concatenate(

concatenate

concatenate(

convolve(a, v[, mode])

Returns the discrete, linear convolution of two one-dimensional sequences.

copy(a[, order, subok])

Return an array copy of the given object.

copyto(dst, src[, casting, where])

Copies values from one array to another, broadcasting as necessary.

corrcoef(x[, y, rowvar, bias, ddof, dtype])

Return Pearson product-moment correlation coefficients.

correlate(a, v[, mode])

Cross-correlation of two 1-dimensional sequences.

count_nonzero(a[, axis, keepdims])

Counts the number of non-zero values in the array a.

cov(m[, y, rowvar, bias, ddof, fweights, ...])

Estimate a covariance matrix, given data and weights.

cross(a, b[, axisa, axisb, axisc, axis])

Return the cross product of two (arrays of) vectors.

cumprod(a[, axis, dtype, out])

Return the cumulative product of elements along a given axis.

cumsum(a[, axis, dtype, out])

Return the cumulative sum of the elements along a given axis.

datetime_as_string(arr[, unit, timezone, ...])

Convert an array of datetimes into an array of strings.

datetime_data(dtype, /)

Get information about the step size of a date or time type.

delete(arr, obj[, axis])

Return a new array with sub-arrays along an axis deleted.

diag(v[, k])

Extract a diagonal or construct a diagonal array.

diag_indices(n[, ndim])

Return the indices to access the main diagonal of an array.

diag_indices_from(arr)

Return the indices to access the main diagonal of an n-dimensional array.

diagflat(v[, k])

Create a two-dimensional array with the flattened input as a diagonal.

diagonal(a[, offset, axis1, axis2])

Return specified diagonals.

diff(a[, n, axis, prepend, append])

Calculate the n-th discrete difference along the given axis.

digitize(x, bins[, right])

Return the indices of the bins to which each value in input array belongs.

dot(a, b[, out])

Dot product of two arrays.

dsplit(ary, indices_or_sections)

Split array into multiple sub-arrays along the 3rd axis (depth).

dstack(tup)

Stack arrays in sequence depth wise (along third axis).

ediff1d(ary[, to_end, to_begin])

The differences between consecutive elements of an array.

einsum(*operands[, out, optimize])

einsum(subscripts, *operands, out=None, dtype=None, order='K',

einsum_path(subscripts, *operands[, optimize])

Evaluates the lowest cost contraction order for an einsum expression by considering the creation of intermediate arrays.

empty(shape[, dtype, order, device, like])

Return a new array of given shape and type, without initializing entries.

empty_like

empty_like(prototype, dtype=None, order='K', subok=True, shape=None, *,

expand_dims(a, axis)

Expand the shape of an array.

extract(condition, arr)

Return the elements of an array that satisfy some condition.

eye(N[, M, k, dtype, order, device, like])

Return a 2-D array with ones on the diagonal and zeros elsewhere.

fill_diagonal(a, val[, wrap])

Fill the main diagonal of the given array of any dimensionality.

fix(x[, out])

Round to nearest integer towards zero.

flatnonzero(a)

Return indices that are non-zero in the flattened version of a.

flip(m[, axis])

Reverse the order of elements in an array along the given axis.

fliplr(m)

Reverse the order of elements along axis 1 (left/right).

flipud(m)

Reverse the order of elements along axis 0 (up/down).

format_float_positional(x[, precision, ...])

Format a floating-point scalar as a decimal string in positional notation.

format_float_scientific(x[, precision, ...])

Format a floating-point scalar as a decimal string in scientific notation.

from_dlpack(x, /)

Create a NumPy array from an object implementing the __dlpack__ protocol.

frombuffer(buffer[, dtype, count, offset, like])

Interpret a buffer as a 1-dimensional array.

fromfile(file[, dtype, count, sep, offset, like])

Construct an array from data in a text or binary file.

fromfunction(function, shape, *[, dtype, like])

Construct an array by executing a function over each coordinate.

fromiter(iter, dtype[, count, like])

Create a new 1-dimensional array from an iterable object.

frompyfunc(func, /, nin, nout, *[, identity])

Takes an arbitrary Python function and returns a NumPy ufunc.

fromregex(file, regexp, dtype[, encoding])

Construct an array from a text file, using regular expression parsing.

fromstring(string[, dtype, count, like])

A new 1-D array initialized from text data in a string.

full(shape, fill_value[, dtype, order, ...])

Return a new array of given shape and type, filled with fill_value.

full_like(a, fill_value[, dtype, order, ...])

Return a full array with the same shape and type as a given array.

genfromtxt(fname[, dtype, comments, ...])

Load data from a text file, with missing values handled as specified.

geomspace(start, stop[, num, endpoint, ...])

Return numbers spaced evenly on a log scale (a geometric progression).

get_include()

Return the directory that contains the NumPy *.h header files.

get_printoptions()

Return the current print options.

getbufsize()

Return the size of the buffer used in ufuncs.

geterr()

Get the current way of handling floating-point errors.

geterrcall()

Return the current callback function used on floating-point errors.

gradient(f, *varargs[, axis, edge_order])

Return the gradient of an N-dimensional array.

hamming(M)

Return the Hamming window.

hanning(M)

Return the Hanning window.

histogram(a[, bins, range, density, weights])

Compute the histogram of a dataset.

histogram2d(x, y[, bins, range, density, ...])

Compute the bi-dimensional histogram of two data samples.

histogram_bin_edges(a[, bins, range, weights])

Function to calculate only the edges of the bins used by the histogram function.

histogramdd(sample[, bins, range, density, ...])

Compute the multidimensional histogram of some data.

hsplit(ary, indices_or_sections)

Split an array into multiple sub-arrays horizontally (column-wise).

hstack(tup, *[, dtype, casting])

Stack arrays in sequence horizontally (column wise).

i0(x)

Modified Bessel function of the first kind, order 0.

identity(n[, dtype, like])

Return the identity array.

imag(val)

Return the imaginary part of the complex argument.

in1d(ar1, ar2[, assume_unique, invert, kind])

Test whether each element of a 1-D array is also present in a second array.

indices(dimensions[, dtype, sparse])

Return an array representing the indices of a grid.

info([object, maxwidth, output, toplevel])

Get help information for an array, function, class, or module.

inner(a, b, /)

Inner product of two arrays.

insert(arr, obj, values[, axis])

Insert values along the given axis before the given indices.

interp(x, xp, fp[, left, right, period])

One-dimensional linear interpolation for monotonically increasing sample points.

intersect1d(ar1, ar2[, assume_unique, ...])

Find the intersection of two arrays.

is_busday

is_busday(

isclose(a, b[, rtol, atol, equal_nan])

Returns a boolean array where two arrays are element-wise equal within a tolerance.

iscomplex(x)

Returns a bool array, where True if input element is complex.

iscomplexobj(x)

Check for a complex type or an array of complex numbers.

isdtype(dtype, kind)

Determine if a provided dtype is of a specified data type kind.

isfortran(a)

Check if the array is Fortran contiguous but not C contiguous.

isin(element, test_elements[, ...])

Calculates element in test_elements, broadcasting over element only.

isneginf(x[, out])

Test element-wise for negative infinity, return result as bool array.

isposinf(x[, out])

Test element-wise for positive infinity, return result as bool array.

isreal(x)

Returns a bool array, where True if input element is real.

isrealobj(x)

Return True if x is a not complex type or an array of complex numbers.

isscalar(element)

Returns True if the type of element is a scalar type.

issubdtype(arg1, arg2)

Returns True if first argument is a typecode lower/equal in type hierarchy.

iterable(y)

Check whether or not an object can be iterated over.

ix_(*args)

Construct an open mesh from multiple sequences.

kaiser(M, beta)

Return the Kaiser window.

kron(a, b)

Kronecker product of two arrays.

lexsort(keys[, axis])

Perform an indirect stable sort using a sequence of keys.

linspace(start, stop[, num, endpoint, ...])

Return evenly spaced numbers over a specified interval.

load(file[, mmap_mode, allow_pickle, ...])

Load arrays or pickled objects from .npy, .npz or pickled files.

loadtxt(fname[, dtype, comments, delimiter, ...])

Load data from a text file.

logspace(start, stop[, num, endpoint, base, ...])

Return numbers spaced evenly on a log scale.

mask_indices(n, mask_func[, k])

Return the indices to access (n, n) arrays, given a masking function.

matrix_transpose(x, /)

Transposes a matrix (or a stack of matrices) x.

max(a[, axis, out, keepdims, initial, where])

Return the maximum of an array or maximum along an axis.

may_share_memory(a, b, /[, max_work])

Determine if two arrays might share memory

mean(a[, axis, dtype, out, keepdims, where])

Compute the arithmetic mean along the specified axis.

median(a[, axis, out, overwrite_input, keepdims])

Compute the median along the specified axis.

meshgrid(*xi[, copy, sparse, indexing])

Return a tuple of coordinate matrices from coordinate vectors.

min(a[, axis, out, keepdims, initial, where])

Return the minimum of an array or minimum along an axis.

min_scalar_type(a, /)

For scalar a, returns the data type with the smallest size and smallest scalar kind which can hold its value.

mintypecode(typechars[, typeset, default])

Return the character for the minimum-size type to which given types can be safely cast.

moveaxis(a, source, destination)

Move axes of an array to new positions.

nan_to_num(x[, copy, nan, posinf, neginf])

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.

nanargmax(a[, axis, out, keepdims])

Return the indices of the maximum values in the specified axis ignoring NaNs.

nanargmin(a[, axis, out, keepdims])

Return the indices of the minimum values in the specified axis ignoring NaNs.

nancumprod(a[, axis, dtype, out])

Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one.

nancumsum(a[, axis, dtype, out])

Return the cumulative sum of array elements over a given axis treating Not a Numbers (NaNs) as zero.

nanmax(a[, axis, out, keepdims, initial, where])

Return the maximum of an array or maximum along an axis, ignoring any NaNs.

nanmean(a[, axis, dtype, out, keepdims, where])

Compute the arithmetic mean along the specified axis, ignoring NaNs.

nanmedian(a[, axis, out, overwrite_input, ...])

Compute the median along the specified axis, while ignoring NaNs.

nanmin(a[, axis, out, keepdims, initial, where])

Return minimum of an array or minimum along an axis, ignoring any NaNs.

nanpercentile(a, q[, axis, out, ...])

Compute the qth percentile of the data along the specified axis, while ignoring nan values.

nanprod(a[, axis, dtype, out, keepdims, ...])

Return the product of array elements over a given axis treating Not a Numbers (NaNs) as ones.

nanquantile(a, q[, axis, out, ...])

Compute the qth quantile of the data along the specified axis, while ignoring nan values.

nanstd(a[, axis, dtype, out, ddof, ...])

Compute the standard deviation along the specified axis, while ignoring NaNs.

nansum(a[, axis, dtype, out, keepdims, ...])

Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero.

nanvar(a[, axis, dtype, out, ddof, ...])

Compute the variance along the specified axis, while ignoring NaNs.

ndim(a)

Return the number of dimensions of an array.

nested_iters(op, axes[, flags, op_flags, ...])

Create nditers for use in nested loops

nonzero(a)

Return the indices of the elements that are non-zero.

ones(shape[, dtype, order, device, like])

Return a new array of given shape and type, filled with ones.

ones_like(a[, dtype, order, subok, shape, ...])

Return an array of ones with the same shape and type as a given array.

outer(a, b[, out])

Compute the outer product of two vectors.

packbits(a, /[, axis, bitorder])

Packs the elements of a binary-valued array into bits in a uint8 array.

pad(array, pad_width[, mode])

Pad an array.

partition(a, kth[, axis, kind, order])

Return a partitioned copy of an array.

percentile(a, q[, axis, out, ...])

Compute the q-th percentile of the data along the specified axis.

permute_dims(a[, axes])

Returns an array with axes transposed.

piecewise(x, condlist, funclist, *args, **kw)

Evaluate a piecewise-defined function.

place(arr, mask, vals)

Change elements of an array based on conditional and input values.

poly(seq_of_zeros)

Find the coefficients of a polynomial with the given sequence of roots.

polyadd(a1, a2)

Find the sum of two polynomials.

polyder(p[, m])

Return the derivative of the specified order of a polynomial.

polydiv(u, v)

Returns the quotient and remainder of polynomial division.

polyfit(x, y, deg[, rcond, full, w, cov])

Least squares polynomial fit.

polyint(p[, m, k])

Return an antiderivative (indefinite integral) of a polynomial.

polymul(a1, a2)

Find the product of two polynomials.

polysub(a1, a2)

Difference (subtraction) of two polynomials.

polyval(p, x)

Evaluate a polynomial at specific values.

printoptions(*args, **kwargs)

Context manager for setting print options.

prod(a[, axis, dtype, out, keepdims, ...])

Return the product of array elements over a given axis.

promote_types(type1, type2)

Returns the data type with the smallest size and smallest scalar kind to which both type1 and type2 may be safely cast.

ptp(a[, axis, out, keepdims])

Range of values (maximum - minimum) along an axis.

put(a, ind, v[, mode])

Replaces specified elements of an array with given values.

put_along_axis(arr, indices, values, axis)

Put values into the destination array by matching 1d index and data slices.

putmask(a, mask, values)

Changes elements of an array based on conditional and input values.

quantile(a, q[, axis, out, overwrite_input, ...])

Compute the q-th quantile of the data along the specified axis.

radialcenter(I[, invert_xy])

Calculates the center of a 2D intensity distribution.

ravel(a[, order])

Return a contiguous flattened array.

ravel_multi_index(multi_index, dims[, mode, ...])

Converts a tuple of index arrays into an array of flat indices, applying boundary modes to the multi-index.

real(val)

Return the real part of the complex argument.

real_if_close(a[, tol])

If input is complex with all imaginary parts close to zero, return real parts.

repeat(a, repeats[, axis])

Repeat each element of an array after themselves

require(a[, dtype, requirements, like])

Return an ndarray of the provided type that satisfies requirements.

reshape(a, newshape[, order])

Gives a new shape to an array without changing its data.

resize(a, new_shape)

Return a new array with the specified shape.

result_type(*arrays_and_dtypes)

Returns the type that results from applying the NumPy type promotion rules to the arguments.

roll(a, shift[, axis])

Roll array elements along a given axis.

rollaxis(a, axis[, start])

Roll the specified axis backwards, until it lies in a given position.

roots(p)

Return the roots of a polynomial with coefficients given in p.

rot90(m[, k, axes])

Rotate an array by 90 degrees in the plane specified by axes.

round(a[, decimals, out])

Evenly round to the given number of decimals.

row_stack(tup, *[, dtype, casting])

Stack arrays in sequence vertically (row wise).

save(file, arr[, allow_pickle, fix_imports])

Save an array to a binary file in NumPy .npy format.

savetxt(fname, X[, fmt, delimiter, newline, ...])

Save an array to a text file.

savez(file, *args, **kwds)

Save several arrays into a single file in uncompressed .npz format.

savez_compressed(file, *args, **kwds)

Save several arrays into a single file in compressed .npz format.

searchsorted(a, v[, side, sorter])

Find indices where elements should be inserted to maintain order.

select(condlist, choicelist[, default])

Return an array drawn from elements in choicelist, depending on conditions.

set_printoptions([precision, threshold, ...])

Set printing options.

setbufsize(size)

Set the size of the buffer used in ufuncs.

setdiff1d(ar1, ar2[, assume_unique])

Find the set difference of two arrays.

seterr([all, divide, over, under, invalid])

Set how floating-point errors are handled.

seterrcall(func)

Set the floating-point error callback function or log object.

setxor1d(ar1, ar2[, assume_unique])

Find the set exclusive-or of two arrays.

shape(a)

Return the shape of an array.

shares_memory(a, b, /[, max_work])

Determine if two arrays share memory.

show_config([mode])

Show libraries and system information on which NumPy was built and is being used

show_runtime()

Print information about various resources in the system including available intrinsic support and BLAS/LAPACK library in use

sinc(x)

Return the normalized sinc function.

size(a[, axis])

Return the number of elements along a given axis.

sort(a[, axis, kind, order, stable])

Return a sorted copy of an array.

sort_complex(a)

Sort a complex array using the real part first, then the imaginary part.

split(ary, indices_or_sections[, axis])

Split an array into multiple sub-arrays as views into ary.

squeeze(a[, axis])

Remove axes of length one from a.

stack(arrays[, axis, out, dtype, casting])

Join a sequence of arrays along a new axis.

std(a[, axis, dtype, out, ddof, keepdims, ...])

Compute the standard deviation along the specified axis.

sum(a[, axis, dtype, out, keepdims, ...])

Sum of array elements over a given axis.

swapaxes(a, axis1, axis2)

Interchange two axes of an array.

take(a, indices[, axis, out, mode])

Take elements from an array along an axis.

take_along_axis(arr, indices, axis)

Take values from the input array by matching 1d index and data slices.

tensordot(a, b[, axes])

Compute tensor dot product along specified axes.

tile(A, reps)

Construct an array by repeating A the number of times given by reps.

trace(a[, offset, axis1, axis2, dtype, out])

Return the sum along diagonals of the array.

transpose(a[, axes])

Returns an array with axes transposed.

trapezoid(y[, x, dx, axis])

Integrate along the given axis using the composite trapezoidal rule.

trapz(y[, x, dx, axis])

trapz is deprecated in NumPy 2.0.

tri(N[, M, k, dtype, like])

An array with ones at and below the given diagonal and zeros elsewhere.

tril(m[, k])

Lower triangle of an array.

tril_indices(n[, k, m])

Return the indices for the lower-triangle of an (n, m) array.

tril_indices_from(arr[, k])

Return the indices for the lower-triangle of arr.

trim_zeros(filt[, trim])

Trim the leading and/or trailing zeros from a 1-D array or sequence.

triu(m[, k])

Upper triangle of an array.

triu_indices(n[, k, m])

Return the indices for the upper-triangle of an (n, m) array.

triu_indices_from(arr[, k])

Return the indices for the upper-triangle of arr.

typename(char)

Return a description for the given data type code.

union1d(ar1, ar2)

Find the union of two arrays.

unique(ar[, return_index, return_inverse, ...])

Find the unique elements of an array.

unique_all(x)

Find the unique elements of an array, and counts, inverse and indices.

unique_counts(x)

Find the unique elements and counts of an input array x.

unique_inverse(x)

Find the unique elements of x and indices to reconstruct x.

unique_values(x)

Returns the unique elements of an input array x.

unpackbits(a, /[, axis, count, bitorder])

Unpacks elements of a uint8 array into a binary-valued output array.

unravel_index(indices, shape[, order])

Converts a flat index or array of flat indices into a tuple of coordinate arrays.

unwrap(p[, discont, axis, period])

Unwrap by taking the complement of large deltas with respect to the period.

vander(x[, N, increasing])

Generate a Vandermonde matrix.

var(a[, axis, dtype, out, ddof, keepdims, ...])

Compute the variance along the specified axis.

vdot(a, b, /)

Return the dot product of two vectors.

vsplit(ary, indices_or_sections)

Split an array into multiple sub-arrays vertically (row-wise).

vstack(tup, *[, dtype, casting])

Stack arrays in sequence vertically (row wise).

where(condition, [x, y], /)

Return elements chosen from x or y depending on condition.

zeros(shape[, dtype, order, like])

Return a new array of given shape and type, filled with zeros.

zeros_like(a[, dtype, order, subok, shape, ...])

Return an array of zeros with the same shape and type as a given array.