Arrays
Array creation, manipulation, and higher-order functions.
arange
Create an array of evenly spaced integers.
arange(start, stop) → Array [start, start+1, ..., stop-1]
cumsum
Cumulative sum of an array.
cumsum(arr) → Array of running totals
delete
Remove an element at the given index.
delete(arr, idx) → New array with element removed
enumerate
Pair each element with its 1-based index.
enumerate(arr) → Array of (index, element) tuples
fill
Create an array filled with a value.
fill(val, n) → Array of n copies of val
filter
Filter array elements by a predicate.
filter(arr, fn) → Array of elements for which fn returns true
length
Number of elements in a collection.
length(x) → Number of elements
linspace
Create an array of evenly spaced values.
linspace(start, stop, n) → Array of n evenly spaced values from start to stop
map
Apply a function to each element.
map(arr, fn) → Array of transformed elements
max
Maximum value.
max(a) → Maximum value
mean
Arithmetic mean of all elements.
mean(arr) → Mean value
min
Minimum value.
min(a) → Minimum value
ndims
Number of dimensions.
ndims(x) → Number of dimensions
ones
Create an array of ones.
ones(n) → Array of n ones
prod
Product of all elements.
prod(arr) → Total product
push
Append an element to an array.
push(arr, val) → New array with val appended
reduce
Reduce an array to a single value using a binary function.
reduce(arr, fn, init) → Accumulated result
reverse
Reverse an array.
reverse(arr) → Reversed array
size
Shape of an array or NDArray.
size(x) → Array of dimension sizes
sort
Sort an array in ascending order.
sort(arr) → Sorted array
sum
Sum of all elements.
sum(arr) → Total sum
zeros
Create an array of zeros.
zeros(n) → Array of n zeros
zip
Combine two arrays element-wise into tuples.
zip(a, b) → Array of (a[i], b[i]) tuples