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
| flag | pulls in |
|---|---|
full | every sub-crate below + f16 + serde |
io | ferray-io (.npy/.npz/text/memmap) |
linalg | ferray-linalg (decomps, solvers, norms) |
fft | ferray-fft (rustfft + realfft) |
random | ferray-random (PCG64 / Xoshiro256) |
polynomial | ferray-polynomial (power + 5 bases) |
window | ferray-window (Kaiser, Bartlett, …) |
strings | ferray-strings (vectorized string ops) |
ma | ferray-ma (masked arrays) |
stride-tricks | ferray-stride-tricks (as_strided, …) |
autodiff | ferray-autodiff (forward-mode dual) |
numpy | ferray-numpy-interop (PyO3 bridge) |
f16 / bf16 | half-precision element types |
serde | Array 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.
- Array
Flags - Flags describing the memory properties of an array.
- Array
View - An immutable, borrowed view into an existing array’s data.
- Array
View Mut - 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.
- Date
Time64 - Calendar instant stored as an i64 count of
TimeUnitticks since the Unix epoch (1970-01-01T00:00:00Z). - Field
Descriptor - 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
TimeUnitticks. - Unique
Result - Result from the
uniquefunction.
Enums§
- Bins
- How to specify bins for histogram functions.
- Convolve
Mode - Convolution mode.
- Correlate
Mode - Mode for the
correlatefunction, mirroringnumpy.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.
- Ferray
Error - The primary error type for all ferray operations.
- Mask
Kind - Mask kind for
mask_indices. - Memory
Layout - Describes the memory layout of an N-dimensional array.
- Quantile
Method - Interpolation method for
quantile_with_methodand itspercentile/medianfriends. - Side
- Side parameter for
searchsorted. - Slice
Info Elem - One element of a multi-axis slice specification, produced by the
s![]macro. - Sort
Kind - Sorting algorithm selection.
- Time
Unit - Time unit for
DateTime64/Timedelta64arrays.
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_dimsindicating 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§
- AsRaw
Buffer - Trait exposing the raw memory layout of an array for zero-copy interop.
- Bitwise
Count - Trait for integer types that expose
count_ones(population count). - Bitwise
Ops - 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.
- Ferray
Record - 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.
- Shift
Ops - 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
NumPybroadcasting. - 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=Noneform). - add_
reduce_ axes - Reduce by addition over multiple axes simultaneously.
- add_
reduce_ keepdims - Reduce by addition along an axis with an optional
keepdimsflag. - 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
axisare truthy, returning an array withaxisremoved. Equivalent tonp.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
axisis truthy, returning an array withaxisremoved. Equivalent tonp.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– matchesNumPy’saround. - 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 bucketx[i], returningArray<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
conditionis 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
srcintodst, broadcastingsrctodst.shape(). - copyto_
where - Copy values from
srcintodstwheremaskistrue, broadcasting bothsrcandmasktodst.shape(). - corrcoef
- Compute the Pearson correlation coefficient matrix.
- correlate
- Discrete, linear cross-correlation of two 1-D arrays.
- cos
- Elementwise cosine. See
sinfor 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
NumPybroadcasting. 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
awhereconditionis 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
ArrayViewover 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 withfill_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
histogramwithout 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
concatenatealong 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
ais also present inb. - 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 returnsfalseeverywhere. - iscomplexobj
- Whether the array’s element dtype is a complex type.
- isfinite
- Elementwise test for finiteness.
- isin
- Test whether each element of
elementis intest_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 returnstrueeverywhere. - 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
xby2^n(ldexp), withNumPybroadcasting. - left_
shift - Elementwise left shift with
NumPybroadcasting. - 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
numevenly spaced values betweenstartandstop. - 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
initialandwhereparameters. - 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
wheremask. - 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
initialandwhereparameters. - 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
NumPybroadcasting. 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
abased on a boolean mask, taking values fromvals(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
initialandwhereparameters. - ptp
- Range (peak-to-peak) of array elements over a given axis.
- putmask
- Change elements of
abased on a boolean mask, broadcasting/cycling values from a same-shape (or scalar)valuesslice 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
NumPybroadcasting. - rint
- Alias for
round– matchesNumPy’srint. - 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
sorteras a permutation that would sorta. - 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
anot inb). - 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
NumPybroadcasting. 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
initialandwhereparameters. - 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
sinfor the libm-vs-core-math accuracy note. - tanh
- Elementwise hyperbolic tangent.
- tile
- Construct an array by repeating
athe number of times given byreps. - 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
concatenatealong 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§
- Ferray
Result - Convenience alias used throughout ferray.
Derive Macros§
- Ferray
Record - Derive macro that generates an
unsafe impl FerrayRecordfor a#[repr(C)]struct.