Skip to main content

Crate ferray

Crate ferray 

Source
Expand description

§ferray — a NumPy-equivalent library for Rust

ferray is the top-level umbrella crate that re-exports every ferray sub-crate under a unified namespace, analogous to import numpy as np in Python. Most users should start here rather than depending on the individual ferray-core, ferray-ufunc, ferray-stats, etc. crates directly.

use ferray::prelude::*;

let a = zeros::<f64, Ix2>(Ix2::new([2, 3])).unwrap();
let b = sin(&a).unwrap();

§Sub-modules

Optional sub-crates are feature-gated and exposed as named modules (ferray::fft, ferray::linalg, ferray::random, ferray::io, ferray::polynomial, ferray::window, ferray::strings, ferray::ma, ferray::stride_tricks, ferray::autodiff, ferray::numpy_interop).

§Features

flagpulls in
fullevery sub-crate below + f16 + serde
ioferray-io (.npy/.npz/text/memmap)
linalgferray-linalg (decomps, solvers, norms)
fftferray-fft (rustfft + realfft)
randomferray-random (PCG64 / Xoshiro256)
polynomialferray-polynomial (power + 5 bases)
windowferray-window (Kaiser, Bartlett, …)
stringsferray-strings (vectorized string ops)
maferray-ma (masked arrays)
stride-tricksferray-stride-tricks (as_strided, …)
autodiffferray-autodiff (forward-mode dual)
numpyferray-numpy-interop (PyO3 bridge)
f16 / bf16half-precision element types
serdeArray serde impls via ferray-core/serde

The umbrella crate itself contains only re-exports and a thin thread-pool config layer, so it forbids unsafe code.

Re-exports§

pub use config::set_num_threads;
pub use config::with_num_threads;
pub use ferray_io as io;
pub use ferray_window as window;
pub use ferray_strings as strings;
pub use ferray_ma as ma;

Modules§

aliases
casting
config
dimension
finfo
histogram
prelude
promotion
threshold
Parallel threshold configuration constants.

Macros§

promoted_type
Compile-time type promotion macro.
s
NumPy-style slice indexing macro.

Structs§

ArcArray
A reference-counted N-dimensional array with copy-on-write semantics.
Array
An owned, heap-allocated N-dimensional array.
ArrayFlags
Flags describing the memory properties of an array.
ArrayView
An immutable, borrowed view into an existing array’s data.
ArrayViewMut
A mutable, borrowed view into an existing array’s data.
Axis
Newtype for axis indices used throughout ferray.
Complex
A complex number in Cartesian form.
DateTime64
Calendar instant stored as an i64 count of TimeUnit ticks since the Unix epoch (1970-01-01T00:00:00Z).
FieldDescriptor
Describes a single field within a structured (record) dtype.
Ix0
A zero-dimensional (scalar) dimension.
Ix1
A fixed-rank dimension with 1 axes.
Ix2
A fixed-rank dimension with 2 axes.
Ix3
A fixed-rank dimension with 3 axes.
Ix4
A fixed-rank dimension with 4 axes.
Ix5
A fixed-rank dimension with 5 axes.
Ix6
A fixed-rank dimension with 6 axes.
IxDyn
A dynamic-rank dimension whose number of axes is determined at runtime.
Timedelta64
Duration stored as an i64 count of TimeUnit ticks.
UniqueResult
Result from the unique function.

Enums§

Bins
How to specify bins for histogram functions.
ConvolveMode
Convolution mode.
CorrelateMode
Mode for the correlate function, mirroring numpy.correlate.
CowArray
A copy-on-write array that is either a borrowed view or an owned array.
DType
Runtime descriptor for the element type stored in an array.
DynArray
A runtime-typed array whose element type is determined at runtime.
FerrayError
The primary error type for all ferray operations.
MaskKind
Mask kind for mask_indices.
MemoryLayout
Describes the memory layout of an N-dimensional array.
QuantileMethod
Interpolation method for quantile_with_method and its percentile / median friends.
Side
Side parameter for searchsorted.
SliceInfoElem
One element of a multi-axis slice specification, produced by the s![] macro.
SortKind
Sorting algorithm selection.
TimeUnit
Time unit for DateTime64 / Timedelta64 arrays.

Constants§

E
Euler’s number, the base of natural logarithms.
EULER_GAMMA
The Euler-Mascheroni constant (gamma ~ 0.5772…).
INF
Positive infinity.
NAN
Not a number (quiet NaN).
NAT
NaT (“Not a Time”) sentinel value — the minimum i64.
NEG_INF
Negative infinity.
NEWAXIS
Sentinel value for expand_dims indicating a new axis should be inserted.
NZERO
Negative zero (-0.0).
PI
The ratio of a circle’s circumference to its diameter.
PZERO
Positive zero (+0.0).

Traits§

AsRawBuffer
Trait exposing the raw memory layout of an array for zero-copy interop.
BitwiseCount
Trait for integer types that expose count_ones (population count).
BitwiseOps
Trait for types that support bitwise operations.
Dimension
Trait for types that describe the dimensionality of an array.
Element
Trait bound for types that can be stored in a ferray array.
FerrayRecord
Trait implemented by types that can be used as structured array elements.
Logical
Trait for types that can be interpreted as boolean for logical ops.
ShiftOps
Trait for types that support shift operations in addition to bitwise ops.

Functions§

abs
Compute the absolute value (magnitude) of complex numbers.
absolute
Elementwise absolute value.
add
Elementwise addition with NumPy broadcasting.
add_accumulate
Running (cumulative) addition along an axis.
add_broadcast
Elementwise addition with broadcasting.
add_datetime_timedelta
Element-wise datetime + timedelta → datetime.
add_datetime_timedelta_promoted
Element-wise datetime[unit_a] + timedelta[unit_b] → datetime[finer].
add_reduce
Reduce by addition along an axis (column sums, row sums, etc.).
add_reduce_all
Reduce by addition over the entire array (the axis=None form).
add_reduce_axes
Reduce by addition over multiple axes simultaneously.
add_reduce_keepdims
Reduce by addition along an axis with an optional keepdims flag.
add_timedelta
Element-wise timedelta + timedelta → timedelta.
add_timedelta_promoted
Element-wise timedelta[unit_a] + timedelta[unit_b] → timedelta[finer].
all
Test whether all elements are truthy.
all_axis
Test whether all elements along axis are truthy, returning an array with axis removed. Equivalent to np.all(input, axis=axis).
allclose
Test whether two arrays are element-wise close within tolerances.
angle
Compute the angle (argument/phase) of complex numbers.
any
Test whether any element is truthy.
any_axis
Test whether any element along axis is truthy, returning an array with axis removed. Equivalent to np.any(input, axis=axis).
append
Append values to the end of an array along an axis.
arange
Create a 1-D array with evenly spaced values within a given interval.
arccos
Elementwise arc cosine.
arccosh
Elementwise inverse hyperbolic cosine.
arcsin
Elementwise arc sine.
arcsinh
Elementwise inverse hyperbolic sine.
arctan
Elementwise arc tangent.
arctan2
Elementwise two-argument arc tangent (atan2).
arctanh
Elementwise inverse hyperbolic tangent.
argmax
Index of the maximum value.
argmin
Index of the minimum value. For axis=None, returns the flat index. For axis=Some(ax), returns indices along that axis.
argsort
Return the indices that would sort an array along the given axis.
argwhere
Return the coordinates of non-zero elements as a 2-D (N, ndim) array.
around
Alias for round – matches NumPy’s around.
array
Create an array from a flat vector and a shape (C-order).
array_add
Array addition (delegates to arithmetic::add).
array_bitand
Array bitwise AND (delegates to bitwise::bitwise_and).
array_bitnot
Array bitwise NOT (delegates to bitwise::bitwise_not).
array_bitor
Array bitwise OR (delegates to bitwise::bitwise_or).
array_bitxor
Array bitwise XOR (delegates to bitwise::bitwise_xor).
array_div
Array division (delegates to arithmetic::divide).
array_equal
Test whether two arrays have the same shape and elements.
array_equiv
Test whether two arrays are element-wise equal within a tolerance, or broadcastable to the same shape and element-wise equal.
array_mul
Array multiplication (delegates to arithmetic::multiply).
array_neg
Array negation (delegates to arithmetic::negative).
array_rem
Array remainder (delegates to arithmetic::remainder).
array_shl
Array left shift (delegates to bitwise::left_shift).
array_shr
Array right shift (delegates to bitwise::right_shift).
array_split
Split an array into sub-arrays at the given indices along axis.
array_sub
Array subtraction (delegates to arithmetic::subtract).
asanyarray
Convert input to an array. Accepts an existing array (no-op clone).
asarray
Interpret existing data as an array without copying (if possible).
asarray_chkfinite
Convert the input to an array, checking for NaNs or infinities.
ascontiguousarray
Return a contiguous array (C order) in memory.
asfortranarray
Return an array (Fortran-order) by transposing then cloning.
atleast_1d
View inputs as arrays with at least one dimension.
atleast_2d
View inputs as arrays with at least two dimensions.
atleast_3d
View inputs as arrays with at least three dimensions.
average
Weighted average of array elements.
bincount
Count occurrences of each value in a non-negative integer array.
bincount_u64
Count occurrences of each value in a non-negative integer array, returning integer counts.
bincount_weighted
Weighted bincount: accumulates weights[i] into bucket x[i], returning Array<f64, Ix1>.
bitwise_and
Elementwise bitwise AND.
bitwise_count
Elementwise population count: number of set bits in each element.
bitwise_not
Elementwise bitwise NOT.
bitwise_or
Elementwise bitwise OR.
bitwise_xor
Elementwise bitwise XOR.
block
Assemble an array from nested blocks.
broadcast_to
Broadcast an array to a new shape (returns a new owned array).
c_
Stack a sequence of 1-D arrays as columns of a 2-D array.
cbrt
Elementwise cube root.
ceil
Elementwise ceiling (round toward positive infinity).
choose
Construct an array from an index array and a list of arrays to choose from.
clip
Clip (limit) values to [a_min, a_max] for float types.
compress
Select slices of an array along an axis where condition is true.
concatenate
Join a sequence of arrays along an existing axis.
conj
Compute the complex conjugate.
conjugate
Alias for conj.
convolve
Discrete, linear convolution of two 1-D arrays.
copy
Return an array copy of the given object.
copysign
Elementwise copysign: magnitude of x1, sign of x2.
copyto
Copy values from src into dst, broadcasting src to dst.shape().
copyto_where
Copy values from src into dst where mask is true, broadcasting both src and mask to dst.shape().
corrcoef
Compute the Pearson correlation coefficient matrix.
correlate
Discrete, linear cross-correlation of two 1-D arrays.
cos
Elementwise cosine. See sin for the libm-vs-core-math accuracy note.
cosh
Elementwise hyperbolic cosine.
count_nonzero
Count the number of non-zero elements along a given axis.
cov
Estimate the covariance matrix.
cross
Cross product of two 3-element 1-D arrays.
cumprod
Cumulative product along an axis (or flattened if axis is None).
cumsum
Cumulative sum along an axis (or flattened if axis is None).
cumulative_prod
Cumulative product (Array API standard name).
cumulative_sum
Cumulative sum (Array API standard name).
deg2rad
Alias for radians.
degrees
Convert radians to degrees.
delete
Delete sub-arrays along an axis.
diag
Extract a diagonal or construct a diagonal array.
diag_indices
Return the indices to access the main diagonal of an n x n array.
diag_indices_from
Return the indices to access the main diagonal of the given array.
diagflat
Create a 2-D array with the flattened input as a diagonal.
diff
Compute the n-th discrete difference along the given axis.
digitize
Return the indices of the bins to which each value belongs.
divide
Elementwise division with NumPy broadcasting. SIMD-dispatched for same-shape f64/f32 inputs (#88).
divide_broadcast
Elementwise division with broadcasting.
divmod
Return (floor_divide, remainder) as a tuple of arrays, with broadcasting.
dsplit
Split array along axis 2 (depth split). Equivalent to split(a, n, 2).
dstack
Stack arrays along the third axis (depth-wise).
ediff1d
Differences between consecutive elements of an array, with optional prepend/append values.
empty
Create an uninitialized array.
empty_like
Create an uninitialized array with the same shape (and element type) as other.
equal
Elementwise equality test.
equal_broadcast
Cross-rank broadcasting equality test.
exp
Elementwise exponential (e^x).
exp2
Elementwise 2^x.
exp_fast
Fast elementwise exponential (e^x) with ≤1 ULP accuracy.
expand_dims
Insert a new axis of length 1 at the given position.
expm1
Elementwise exp(x) - 1, accurate near zero.
extract
Return the elements of a where condition is true, as a 1-D array.
eye
Create a 2-D array with ones on the diagonal and zeros elsewhere.
fabs
Alias for absolute — float abs.
fix
Elementwise fix: round toward zero (same as trunc for real numbers).
flatnonzero
Return the indices of non-zero elements in the flattened array.
flatten
Return a flattened (1-D) copy of the array.
flip
Reverse the order of elements along the given axis.
fliplr
Flip array left-right (reverse axis 1).
flipud
Flip array up-down (reverse axis 0).
float_power
Float power: x1^x2, always returning float.
floor
Elementwise floor (round toward negative infinity).
floor_divide
Floor division: floor(a / b).
fmax
Elementwise maximum, ignoring NaN.
fmin
Elementwise minimum, ignoring NaN.
fmod
C-style fmod (remainder has same sign as dividend).
frexp
Decompose into mantissa and exponent: x = m * 2^e.
frombuffer
Create an array from a byte buffer, interpreting bytes as elements of type T.
frombuffer_view
Create a zero-copy ArrayView over an existing byte buffer (#364).
fromfile
Read a 1-D array from a file by parsing whitespace-delimited tokens.
fromfunction
Construct an array by executing a function over each coordinate.
fromiter
Create a 1-D array from an iterator.
fromstring
Construct a 1-D array from a whitespace- or separator-delimited string.
full
Create an array filled with a given value.
full_like
Create an array with the same shape as other, filled with fill_value.
gcd
Integer GCD (works on float representations of integers).
geomspace
Create a 1-D array with values spaced evenly on a geometric (log) scale.
get_print_options
Get current print options as (precision, threshold, linewidth, edgeitems).
gradient
Compute the gradient of a 1-D array using central differences.
greater
Elementwise greater-than test.
greater_broadcast
Cross-rank broadcasting greater-than test.
greater_equal
Elementwise greater-than-or-equal test.
greater_equal_broadcast
Cross-rank broadcasting greater-than-or-equal test.
heaviside
Heaviside step function.
histogram
Compute the histogram of a dataset.
histogram2d
Compute the 2-D histogram of two data arrays.
histogram_bin_edges
Compute the bin edges that would be used by histogram without counting anything.
histogramdd
Compute a multi-dimensional histogram.
hsplit
Split array along axis 1 (horizontal split). Equivalent to split(a, n, 1).
hstack
Stack arrays horizontally (column-wise). Equivalent to concatenate along axis 1 for 2-D+ arrays, or along axis 0 for 1-D arrays.
hypot
Elementwise hypotenuse: sqrt(a^2 + b^2).
i0
Modified Bessel function of the first kind, order 0.
identity
Create a 2-D identity matrix of size n x n.
imag
Extract the imaginary part of a complex array.
in1d
Test whether each element of a is also present in b.
indices
Return arrays representing the indices of a grid.
insert
Insert values along an axis before a given index.
interp
1-D linear interpolation.
interp_one
Convenience: interpolate a single scalar query point.
intersect1d
Return the sorted intersection of two 1-D arrays.
invert
Alias for bitwise_not.
isclose
Elementwise close-within-tolerance test.
isclose_broadcast
Cross-rank broadcasting close-within-tolerance test.
iscomplex
Element-wise: true where the imaginary part is non-zero.
iscomplex_real
Real-input variant of iscomplex: always returns false everywhere.
iscomplexobj
Whether the array’s element dtype is a complex type.
isfinite
Elementwise test for finiteness.
isin
Test whether each element of element is in test_elements.
isinf
Elementwise test for infinity (positive or negative).
isnan
Elementwise test for NaN.
isnat_datetime
Element-wise: true where the input is the NaT (“Not a Time”) sentinel.
isnat_timedelta
Element-wise: true where the input is the NaT sentinel.
isneginf
Elementwise test for negative infinity.
isposinf
Elementwise test for positive infinity.
isreal
Element-wise: true where the imaginary part is zero.
isreal_real
Real-input variant of isreal: always returns true everywhere.
isrealobj
Whether the array’s element dtype is a real (non-complex) type.
isscalar
Whether the array represents a scalar (0-D).
ix_
Construct an open mesh from multiple sequences.
lcm
Integer LCM (works on float representations of integers).
ldexp
Multiply x by 2^n (ldexp), with NumPy broadcasting.
left_shift
Elementwise left shift with NumPy broadcasting.
less
Elementwise less-than test.
less_broadcast
Cross-rank broadcasting less-than test.
less_equal
Elementwise less-than-or-equal test.
less_equal_broadcast
Cross-rank broadcasting less-than-or-equal test.
lexsort
Indirect stable sort using a sequence of keys.
linspace
Create a 1-D array with num evenly spaced values between start and stop.
log
Elementwise natural logarithm.
log2
Elementwise base-2 logarithm.
log1p
Elementwise ln(1 + x), accurate near zero.
log10
Elementwise base-10 logarithm.
logaddexp
log(exp(a) + exp(b)), computed in a numerically stable way.
logaddexp2
log2(2^a + 2^b), computed in a numerically stable way.
logical_and
Elementwise logical AND.
logical_not
Elementwise logical NOT.
logical_or
Elementwise logical OR.
logical_xor
Elementwise logical XOR.
logspace
Create a 1-D array with values spaced evenly on a log scale.
mask_indices
Return the flat indices into an (n, n) array where the chosen mask is true.
max
Maximum value of array elements over a given axis.
max_into
Max reduction writing into a pre-allocated destination.
max_with
Max reduction with initial and where parameters.
maximum
Elementwise maximum, propagating NaN.
mean
Mean of array elements over a given axis.
mean_into
Mean reduction writing into a pre-allocated destination.
mean_where
Mean reduction with a where mask.
median
Compute the median of array elements along a given axis.
meshgrid
Return coordinate arrays from coordinate vectors.
mgrid
Create a dense multi-dimensional “meshgrid” with matrix (‘ij’) indexing.
min
Minimum value of array elements over a given axis.
min_into
Min reduction writing into a pre-allocated destination.
min_with
Min reduction with initial and where parameters.
minimum
Elementwise minimum, propagating NaN.
mod_
Alias for remainder.
modf
Decompose into fractional and integer parts.
moveaxis
Move an axis to a new position.
multiply
Elementwise multiplication with NumPy broadcasting. SIMD-dispatched for same-shape f64/f32 inputs (#88).
multiply_broadcast
Elementwise multiplication with broadcasting.
multiply_outer
Outer product: multiply_outer(a, b)[i, j] = a[i] * b[j].
nan_add_reduce
Reduce by NaN-skipping addition along an axis with optional keepdims.
nan_add_reduce_all
Reduce by NaN-skipping addition over the entire array.
nan_add_reduce_axes
Reduce by NaN-skipping addition over multiple axes simultaneously.
nan_max_reduce
Reduce by NaN-skipping maximum along an axis with optional keepdims.
nan_max_reduce_all
Reduce by NaN-skipping maximum over the entire array.
nan_max_reduce_axes
Reduce by NaN-skipping maximum over multiple axes.
nan_min_reduce
Reduce by NaN-skipping minimum along an axis with optional keepdims.
nan_min_reduce_all
Reduce by NaN-skipping minimum over the entire array.
nan_min_reduce_axes
Reduce by NaN-skipping minimum over multiple axes.
nan_multiply_reduce
Reduce by NaN-skipping multiplication along an axis with optional keepdims.
nan_multiply_reduce_all
Reduce by NaN-skipping multiplication over the entire array.
nan_multiply_reduce_axes
Reduce by NaN-skipping multiplication over multiple axes.
nan_to_num
Replace NaN with zero, and infinity with large finite numbers.
nanargmax
Index of the maximum value, skipping NaN. Errors on all-NaN input.
nanargmin
Index of the minimum value, skipping NaN. Errors on all-NaN input.
nancumprod
Cumulative product ignoring NaNs.
nancumsum
Cumulative sum ignoring NaNs.
nanmax
Maximum of array elements, skipping NaN.
nanmean
Mean of array elements, skipping NaN. Returns NaN for all-NaN slices.
nanmedian
Median, skipping NaN values.
nanmin
Minimum of array elements, skipping NaN.
nanpercentile
Percentile, skipping NaN values.
nanprod
Product of array elements, treating NaN as one.
nanstd
Standard deviation of array elements, skipping NaN.
nansum
Sum of array elements, treating NaN as zero.
nanvar
Variance of array elements, skipping NaN.
ndenumerate
Create an iterator yielding (index, &value) pairs.
ndindex
Create an iterator over all multi-dimensional indices for a shape.
negative
Elementwise negation.
nextafter
Return the next floating-point value after x1 towards x2, using IEEE 754 bit manipulation.
nonzero
Return the indices of non-zero elements, one index vector per axis.
not_equal
Elementwise inequality test.
not_equal_broadcast
Cross-rank broadcasting inequality test.
ogrid
Create a sparse (open) multi-dimensional “meshgrid” with ‘ij’ indexing.
ones
Create an array filled with ones.
ones_like
Create an array with the same shape as other, filled with ones.
pad
Pad an N-D array.
percentile
Compute the q-th percentile of array data along a given axis.
percentile_with_method
Compute the q-th percentile of array data along a given axis using a specific interpolation method.
place
Change elements of a based on a boolean mask, taking values from vals (cycling) where the mask is true.
positive
Elementwise positive (identity for numeric types).
power
Elementwise power: a^b.
prod
Product of array elements over a given axis.
prod_into
Product reduction writing into a pre-allocated destination.
prod_with
Product reduction with initial and where parameters.
ptp
Range (peak-to-peak) of array elements over a given axis.
putmask
Change elements of a based on a boolean mask, broadcasting/cycling values from a same-shape (or scalar) values slice where the mask is true.
quantile
Compute the q-th quantile of array data along a given axis.
quantile_with_method
Compute the q-th quantile of array data along a given axis using a specific interpolation method.
r_
Concatenate a sequence of 1-D arrays into a single 1-D array.
rad2deg
Alias for degrees.
radians
Convert degrees to radians.
ravel
Return a flattened (1-D) copy of the array.
ravel_multi_index
Convert a tuple of index arrays to a flat index array.
real
Extract the real part of a complex array.
reciprocal
Elementwise reciprocal: 1/x.
remainder
Elementwise remainder (Python-style modulo).
repeat
Repeat elements of an array.
require
Return a contiguous array meeting requirements.
reshape
Reshape an array to a new shape (returns a new owned array).
resize
Resize an array to a new shape.
right_shift
Elementwise right shift with NumPy broadcasting.
rint
Alias for round – matches NumPy’s rint.
roll
Roll elements along an axis. Elements that roll past the end are re-introduced at the beginning.
rollaxis
Roll an axis to a new position (similar to moveaxis).
rot90
Rotate array 90 degrees counterclockwise in the plane defined by axes (0, 1).
round
Elementwise banker’s rounding (round half to even).
searchsorted
Find indices where elements should be inserted to maintain order.
searchsorted_with_sorter
Find indices where elements should be inserted to maintain order, using sorter as a permutation that would sort a.
select
Return an array drawn from elements in choicelist, depending on conditions.
set_print_options
Configure how arrays are printed.
setdiff1d
Return the sorted set difference of two 1-D arrays (elements in a not in b).
setxor1d
Return the sorted symmetric difference of two 1-D arrays.
sign
Elementwise sign: -1 for negative, 0 for zero, +1 for positive.
signbit
Elementwise sign bit test.
sin
Elementwise sine.
sinc
Normalized sinc function: sin(pix) / (pix).
sinh
Elementwise hyperbolic sine.
sort
Sort an array along the given axis (or flattened if axis is None).
sort_complex
Sort a 1-D complex array, comparing first by real part, then by imaginary.
spacing
Return the spacing of values: the ULP (unit in the last place), computed via IEEE 754 bit manipulation.
split
Split an array into equal-sized sub-arrays.
sqrt
Elementwise square root.
square
Elementwise square: x^2.
squeeze
Remove axes of length 1 from the shape.
stack
Join a sequence of arrays along a new axis.
std_
Standard deviation of array elements over a given axis.
std_into
Standard deviation reduction writing into a pre-allocated destination.
sub_datetime
Element-wise datetime - datetime → timedelta (same unit assumed).
sub_datetime_promoted
Element-wise datetime[unit_a] - datetime[unit_b] → timedelta[finer].
sub_datetime_timedelta
Element-wise datetime - timedelta → datetime.
sub_timedelta
Element-wise timedelta - timedelta → timedelta.
subtract
Elementwise subtraction with NumPy broadcasting. SIMD-dispatched for same-shape f64/f32 inputs (#88).
subtract_broadcast
Elementwise subtraction with broadcasting.
sum
Sum of array elements over a given axis, or over all elements if axis is None.
sum_into
Sum reduction writing into a pre-allocated destination.
sum_with
Sum reduction with initial and where parameters.
swapaxes
Swap two axes of an array.
take
Take elements from an array along an axis.
take_along_axis
Take values from an array along an axis using an index slice.
tan
Elementwise tangent. See sin for the libm-vs-core-math accuracy note.
tanh
Elementwise hyperbolic tangent.
tile
Construct an array by repeating a the number of times given by reps.
transpose
Permute the axes of an array.
trapezoid
Integrate using the trapezoidal rule.
tri
Create a lower-triangular matrix of ones.
tril
Return the lower triangle of a 2-D array.
tril_indices
Return the indices for the lower triangle of an (n, m) array.
tril_indices_from
Return the indices for the lower triangle of the given 2-D array.
trim_zeros
Trim leading and/or trailing zeros from a 1-D array.
triu
Return the upper triangle of a 2-D array.
triu_indices
Return the indices for the upper triangle of an (n, m) array.
triu_indices_from
Return the indices for the upper triangle of the given 2-D array.
true_divide
Alias for divide — true division (float).
trunc
Elementwise truncation (round toward zero).
union1d
Return the sorted union of two 1-D arrays.
unique
Find the sorted unique elements of an array.
unique_all
Sorted unique values along with first-occurrence indices, inverse, and counts.
unique_counts
Sorted unique values and their occurrence counts.
unique_inverse
Sorted unique values and the inverse-index array.
unique_values
Sorted unique values of the (flattened) array.
unravel_index
Convert flat indices to a tuple of coordinate arrays.
unwrap
Unwrap by changing deltas between values to their 2*pi complement.
vander
Generate a Vandermonde matrix.
var
Variance of array elements over a given axis.
var_into
Variance reduction writing into a pre-allocated destination.
vsplit
Split array along axis 0 (vertical split). Equivalent to split(a, n, 0).
vstack
Stack arrays vertically (row-wise). Equivalent to concatenate along axis 0 for 2-D+ arrays, or equivalent to stacking 1-D arrays as rows.
where_
Conditional element selection.
zeros
Create an array filled with zeros.
zeros_like
Create an array with the same shape as other, filled with zeros.

Type Aliases§

FerrayResult
Convenience alias used throughout ferray.

Derive Macros§

FerrayRecord
Derive macro that generates an unsafe impl FerrayRecord for a #[repr(C)] struct.