Base (i.e., lower-level) array utilities.
var ns = require( '@stdlib/array/base' );
Array utilities.
var o = ns;
// returns {...}
The namespace exports the following:
accessorGetter( dtype )
: return an accessor function for retrieving an element from an array-like object supporting the get/set protocol.accessorSetter( dtype )
: return an accessor function for setting an element in an array-like object supporting the get/set protocol.AccessorArray( arr )
: create a minimal array-like object supporting the accessor protocol from another array-like object.accessors( x )
: return element accessors for a provided array-like object.arraylike2object( x )
: convert an array-like object to an object likely to have the same "shape".assert
: base array assertion utilities.bifurcateEntries( x, filter )
: split array element entries into two groups.bifurcateIndices( x, filter )
: split array element indices into two groups.bifurcateValues( x, filter )
: split array element values into two groups.binary2d( arrays, shape, fcn )
: apply a binary callback to elements in two two-dimensional nested input arrays and assign results to elements in a two-dimensional nested output array.binary3d( arrays, shape, fcn )
: apply a binary callback to elements in two three-dimensional nested input arrays and assign results to elements in a three-dimensional nested output array.binary4d( arrays, shape, fcn )
: apply a binary callback to elements in two four-dimensional nested input arrays and assign results to elements in a four-dimensional nested output array.binary5d( arrays, shape, fcn )
: apply a binary callback to elements in two five-dimensional nested input arrays and assign results to elements in a five-dimensional nested output array.binarynd( arrays, shape, fcn )
: apply a binary callback to elements in two n-dimensional nested input arrays and assign results to elements in an n-dimensional nested output array.broadcastArray( x, inShape, outShape )
: broadcast an array to a specified shape.bbinary2d( arrays, shapes, fcn )
: apply a binary callback to elements in two broadcasted nested input arrays and assign results to elements in a two-dimensional nested output array.bbinary3d( arrays, shapes, fcn )
: apply a binary callback to elements in two broadcasted nested input arrays and assign results to elements in a three-dimensional nested output array.bbinary4d( arrays, shapes, fcn )
: apply a binary callback to elements in two broadcasted nested input arrays and assign results to elements in a four-dimensional nested output array.bbinary5d( arrays, shapes, fcn )
: apply a binary callback to elements in two broadcasted nested input arrays and assign results to elements in a five-dimensional nested output array.bquaternary2d( arrays, shapes, fcn )
: apply a quaternary callback to elements in four broadcasted nested input arrays and assign results to elements in a two-dimensional nested output array.bquinary2d( arrays, shapes, fcn )
: apply a quinary callback to elements in four broadcasted nested input arrays and assign results to elements in a two-dimensional nested output array.bternary2d( arrays, shapes, fcn )
: apply a ternary callback to elements in three broadcasted nested input arrays and assign results to elements in a two-dimensional nested output array.bunary2d( arrays, shapes, fcn )
: apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a two-dimensional nested output array.bunary3d( arrays, shapes, fcn )
: apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a three-dimensional nested output array.bunary4d( arrays, shapes, fcn )
: apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a four-dimensional nested output array.bunary5d( arrays, shapes, fcn )
: apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a five-dimensional nested output array.cartesianPower( x, n )
: return the Cartesian power.cartesianProduct( x1, x2 )
: return the Cartesian product.cartesianSquare( x )
: return the Cartesian square.copyIndexed( x )
: copy the elements of an indexed array-like object to a new "generic" array.copy( x )
: copy the elements of an array-like object to a new "generic" array.dedupe( x, limit, equalNaNs )
: remove consecutive duplicated values.filledBy( len, clbk[, thisArg] )
: create a filled "generic" array according to a provided callback function.filled( value, len )
: create a filled "generic" array.filled2dBy( shape, clbk[, thisArg] )
: create a filled two-dimensional nested array according to a provided callback function.filled2d( value, shape )
: create a filled two-dimensional nested array.filled3dBy( shape, clbk[, thisArg] )
: create a filled three-dimensional nested array according to a provided callback function.filled3d( value, shape )
: create a filled three-dimensional nested array.filled4dBy( shape, clbk[, thisArg] )
: create a filled four-dimensional nested array according to a provided callback function.filled4d( value, shape )
: create a filled four-dimensional nested array.filled5dBy( shape, clbk[, thisArg] )
: create a filled five-dimensional nested array according to a provided callback function.filled5d( value, shape )
: create a filled five-dimensional nested array.filledndBy( shape, clbk[, thisArg] )
: create a filled n-dimensional nested array according to a provided callback function.fillednd( value, shape )
: create a filled n-dimensional nested array.first( x )
: return the first element of an array-like object.flattenBy( x, shape, colexicographic, clbk[, thisArg] )
: flatten an n-dimensional nested array according to a callback function.flatten( x, shape, colexicographic )
: flatten an n-dimensional nested array.flatten2dBy( x, shape, colexicographic, clbk[, thisArg] )
: flatten a two-dimensional nested array according to a callback function.flatten2d( x, shape, colexicographic )
: flatten a two-dimensional nested array.flatten3dBy( x, shape, colexicographic, clbk[, thisArg] )
: flatten a three-dimensional nested array according to a callback function.flatten3d( x, shape, colexicographic )
: flatten a three-dimensional nested array.flatten4dBy( x, shape, colexicographic, clbk[, thisArg] )
: flatten a four-dimensional nested array according to a callback function.flatten4d( x, shape, colexicographic )
: flatten a four-dimensional nested array.flatten5dBy( x, shape, colexicographic, clbk[, thisArg] )
: flatten a five-dimensional nested array according to a callback function.flatten5d( x, shape, colexicographic )
: flatten a five-dimensional nested array.fliplr2d( x )
: reverse the order of elements along the last dimension of a two-dimensional nested input array.fliplr3d( x )
: reverse the order of elements along the last dimension of a three-dimensional nested input array.fliplr4d( x )
: reverse the order of elements along the last dimension of a four-dimensional nested input array.fliplr5d( x )
: reverse the order of elements along the last dimension of a five-dimensional nested input array.flipud2d( x )
: reverse the order of elements along the first dimension of a two-dimensional nested input array.flipud3d( x )
: reverse the order of elements along the second-to-last dimension of a three-dimensional nested input array.flipud4d( x )
: reverse the order of elements along the second-to-last dimension of a four-dimensional nested input array.flipud5d( x )
: reverse the order of elements along the second-to-last dimension of a five-dimensional nested input array.strided2array( N, x, stride, offset )
: convert a strided array to a non-strided generic array.getter( dtype )
: return an accessor function for retrieving an element from an indexed array-like object.groupEntries( x, groups )
: group element entries as arrays associated with distinct keys.groupIndices( x, groups )
: group element indices as arrays associated with distinct keys.groupValues( x, groups )
: group elements as arrays associated with distinct keys.incrspace( start, stop, increment )
: generate a linearly spaced numeric array according to a provided increment.indexOf( x, searchElement, fromIndex, equalNaNs )
: return the index of the first element which equals a provided search element.lastIndexOf( x, searchElement, fromIndex, equalNaNs )
: return the index of the last element which equals a provided search element.last( x )
: return the last element of an array-like object.linspace( start, stop, length )
: generate a linearly spaced numeric array.logspace( a, b, length )
: generate a logarithmically spaced numeric array.map2d( x, shape, fcn[, thisArg] )
: apply a function to elements in a two-dimensional nested input array and assign results to elements in a new two-dimensional nested output array.map3d( x, shape, fcn[, thisArg] )
: apply a function to elements in a three-dimensional nested input array and assign results to elements in a new three-dimensional nested output array.map4d( x, shape, fcn[, thisArg] )
: apply a function to elements in a four-dimensional nested input array and assign results to elements in a new four-dimensional nested output array.map5d( x, shape, fcn[, thisArg] )
: apply a function to elements in a five-dimensional nested input array and assign results to elements in a new five-dimensional nested output array.mskbinary2d( arrays, shape, fcn )
: apply a binary callback to elements in two two-dimensional nested input arrays according to elements in a two-dimensional nested mask array and assign results to elements in a two-dimensional nested output array.mskunary2d( arrays, shape, fcn )
: apply a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assign results to elements in a two-dimensional nested output array.mskunary3d( arrays, shape, fcn )
: apply a unary callback to elements in a three-dimensional nested input array according to elements in a three-dimensional nested mask array and assign results to elements in a three-dimensional nested output array.nCartesianProduct( x1, x2[, ...xN] )
: return the n-fold Cartesian product.oneTo( n )
: generate a linearly spaced numeric array whose elements increment by 1 starting from one.ones( len )
: create a "generic" array filled with ones.ones2d( shape )
: create a two-dimensional nested array filled with ones.ones3d( shape )
: create a three-dimensional nested array filled with ones.ones4d( shape )
: create a four-dimensional nested array filled with ones.ones5d( shape )
: create a five-dimensional nested array filled with ones.onesnd( shape )
: create an n-dimensional nested array filled with ones.quaternary2d( arrays, shape, fcn )
: apply a quaternary callback to elements in four two-dimensional nested input arrays and assign results to elements in a two-dimensional nested output array.quaternary3d( arrays, shape, fcn )
: apply a quaternary callback to elements in four three-dimensional nested input arrays and assign results to elements in a three-dimensional nested output array.quaternary4d( arrays, shape, fcn )
: apply a quaternary callback to elements in four four-dimensional nested input arrays and assign results to elements in a four-dimensional nested output array.quaternary5d( arrays, shape, fcn )
: apply a quaternary callback to elements in four five-dimensional nested input arrays and assign results to elements in a five-dimensional nested output array.quinary2d( arrays, shape, fcn )
: apply a quinary callback to elements in five two-dimensional nested input arrays and assign results to elements in a two-dimensional nested output array.quinary3d( arrays, shape, fcn )
: apply a quinary callback to elements in five three-dimensional nested input arrays and assign results to elements in a three-dimensional nested output array.quinary4d( arrays, shape, fcn )
: apply a quinary callback to elements in five four-dimensional nested input arrays and assign results to elements in a four-dimensional nested output array.quinary5d( arrays, shape, fcn )
: apply a quinary callback to elements in five five-dimensional nested input arrays and assign results to elements in a five-dimensional nested output array.resolveGetter( x )
: return an accessor function for retrieving an element from an array-like object.setter( dtype )
: return an accessor function for setting an element in an indexed array-like object.slice( x, start, end )
: return a shallow copy of a portion of an array.strided2array2d( x, shape, strides, offset )
: convert a strided array to a two-dimensional nested array.strided2array3d( x, shape, strides, offset )
: convert a strided array to a three-dimensional nested array.strided2array4d( x, shape, strides, offset )
: convert a strided array to a four-dimensional nested array.strided2array5d( x, shape, strides, offset )
: convert a strided array to a five-dimensional nested array.takeIndexed( x, indices )
: take elements from an indexed array.take( x, indices )
: take elements from an array.take2d( x, indices, dimension, mode )
: take elements from a two-dimensional nested array.take3d( x, indices, dimension, mode )
: take elements from a three-dimensional nested array.ternary2d( arrays, shape, fcn )
: apply a ternary callback to elements in three two-dimensional nested input arrays and assign results to elements in a two-dimensional nested output array.ternary3d( arrays, shape, fcn )
: apply a ternary callback to elements in three three-dimensional nested input arrays and assign results to elements in a three-dimensional nested output array.ternary4d( arrays, shape, fcn )
: apply a ternary callback to elements in three four-dimensional nested input arrays and assign results to elements in a four-dimensional nested output array.ternary5d( arrays, shape, fcn )
: apply a ternary callback to elements in three five-dimensional nested input arrays and assign results to elements in a five-dimensional nested output array.toAccessorArray( arr )
: convert an array-like object to a minimal array-like object supporting the accessor protocol.toDeduped( x, limit, equalNaNs )
: copy elements to a new "generic" array after removing consecutive duplicated values.unary2dBy( arrays, shape, fcn, clbk[, thisArg] )
: apply a unary function to each element retrieved from a two-dimensional nested input array according to a callback function and assign results to elements in a two-dimensional nested output array.unary2d( arrays, shape, fcn )
: apply a unary callback to elements in a two-dimensional nested input array and assign results to elements in a two-dimensional nested output array.unary3d( arrays, shape, fcn )
: apply a unary callback to elements in a three-dimensional nested input array and assign results to elements in a three-dimensional nested output array.unary4d( arrays, shape, fcn )
: apply a unary callback to elements in a four-dimensional nested input array and assign results to elements in a four-dimensional nested output array.unary5d( arrays, shape, fcn )
: apply a unary callback to elements in a five-dimensional nested input array and assign results to elements in a five-dimensional nested output array.unarynd( arrays, shape, fcn )
: apply a unary callback to elements in an n-dimensional nested input array and assign results to elements in an n-dimensional nested output array.unitspace( start, stop )
: generate a linearly spaced numeric array whose elements increment by 1.zeroTo( n )
: generate a linearly spaced numeric array whose elements increment by 1 starting from zero.zeros( len )
: create a zero-filled "generic" array.zeros2d( shape )
: create a zero-filled two-dimensional nested array.zeros3d( shape )
: create a zero-filled three-dimensional nested array.zeros4d( shape )
: create a zero-filled four-dimensional nested array.zeros5d( shape )
: create a zero-filled five-dimensional nested array.zerosnd( shape )
: create a zero-filled n-dimensional nested array.
var objectKeys = require( '@stdlib/utils/keys' );
var ns = require( '@stdlib/array/base' );
console.log( objectKeys( ns ) );