Return to index

array functions

number = argmax(array)

top

Find index of maximum value in array. Supports multi-dimensional arrays via flattening.

Example:

# Example for argmax
println argmax([1, 5, 3, 2, 4])


number = argmin(array)

top

Find index of minimum value in array. Supports multi-dimensional arrays via flattening.

Example:

# Example for argmin
println argmin([1, 5, 3, 2, 4])


array = concatenate(arrays...,axis?)

top

Join arrays along an existing axis. Axis 0 (default) concatenates vertically, axis 1 horizontally.

Example:

# Example for concatenate
println concatenate([[1, 2], [3, 4]])


number = det(matrix)

top

Calculate determinant of a square matrix.

Example:

# Example for det
println det([[1, 2], [3, 4]])


big.Float = det_big(matrix)

top

Calculate determinant of a square matrix with arbitrary precision using big.Float.

Example:

# Example for det_big
println det_big([[1, 2], [3, 4]])


array = find(array,condition/value)

top

Find indices of non-zero elements, elements matching value, or elements matching condition string.

Example:

# Example for find
println find([1, 2, 3, 4, 5], 3)


array = flatten(array)

top

Flatten multi-dimensional array to 1-D array.

Example:

# Example for flatten
println flatten([[1, 2], [3, 4]])


array = identity(size)

top

Create identity matrix of specified size.

Example:

# Example for identity
println identity(42 + 8)


array = inverse(matrix)

top

Calculate inverse of a square matrix.

Example:

# Example for inverse
println inverse([[1, 2], [3, 4]])


array = inverse_big(matrix)

top

Calculate inverse of a square matrix with arbitrary precision using big.Float.

Example:

# Example for inverse_big
println inverse_big([[1, 2], [3, 4]])


number = mean(array)

top

Calculate the arithmetic mean of values in an array. Supports multi-dimensional arrays.

Example:

# Example for mean
println mean([1, 2, 3, 4, 5])


number = median(array)

top

Calculate the median value in an array. Supports multi-dimensional arrays.

Example:

# Example for median
println median([1, 2, 3, 4, 5])


array = ones(dims...)

top

Create array filled with ones. Dimensions can be provided as separate arguments or as a single array.

Example:

# Example for ones
println ones(3, 4)


number = rank(matrix)

top

Calculate rank of a matrix.

Example:

# Example for rank
println rank([[1, 2], [3, 4]])


array = reshape(array,new_dims)

top

Reshape array to new dimensions. Total elements must remain constant.

Example:

# Example for reshape
println reshape([1, 2, 3, 4, 5, 6], [2, 3])


array = squeeze(array)

top

Remove singleton dimensions from array.

Example:

# Example for squeeze
println squeeze([[1, 2, 3]])


array = stack(arrays...,axis?)

top

Stack arrays along a new axis. Axis 0 (default) stacks vertically, axis 1 horizontally.

Example:

# Example for stack
println stack([1, 2, 3])


number|array = std(array,axis?,keepdims?)

top

Calculate the standard deviation of values. axis: -1/None=flatten, 0=first dim, 1=second dim. keepdims: preserve dimensions.

Example:

# Example for std
println std([1, 2, 3, 4, 5])


number = trace(matrix)

top

Calculate trace (sum of diagonal elements) of a square matrix.

Example:

# Example for trace
println trace([[1, 2], [3, 4]])


number|array = variance(array,axis?,keepdims?)

top

Calculate the variance of values. axis: -1/None=flatten, 0=first dim, 1=second dim. keepdims: preserve dimensions.

Example:

# Example for variance
println variance([1, 2, 3, 4, 5])


array = where(input_array,condition[,true_values][,false_values])

top

Select elements from array based on condition. Supports chaining and scalar broadcasting.

Example:

# Example for where
println where([1, 2, 3, 4, 5], "#>3")


array = zeros(dims...)

top

Create array filled with zeros. Dimensions can be provided as separate arguments or as a single array.

Example:

# Example for zeros
println zeros(3, 4)