Options
All
  • Public
  • Public/Protected
  • All
Menu

Module index

This is default exported nj module page. Below References, Namespaces, Properties, Functions are all exported. For example, after import nj via import nj from "@d4c/numjs"; or const nj = require('@d4c/numjs').default;, you can use nj.array to use create a NdArray.

Index

References

NdArray

Re-exports NdArray

errors

Re-exports errors

Properties

config

config: { nFloatingValues: number; printThreshold: number }

Type declaration

  • nFloatingValues: number
  • printThreshold: number

dtypes

dtypes: { array: ArrayConstructor; float32: Float32ArrayConstructor; float64: Float64ArrayConstructor; int16: Int16ArrayConstructor; int32: Int32ArrayConstructor; int8: Int8ArrayConstructor; uint16: Uint16ArrayConstructor; uint32: Uint32ArrayConstructor; uint8: Uint8ArrayConstructor; uint8_clamped: Uint8ClampedArrayConstructor }

Type declaration

  • array: ArrayConstructor
  • float32: Float32ArrayConstructor
  • float64: Float64ArrayConstructor
  • int16: Int16ArrayConstructor
  • int32: Int32ArrayConstructor
  • int8: Int8ArrayConstructor
  • uint16: Uint16ArrayConstructor
  • uint32: Uint32ArrayConstructor
  • uint8: Uint8ArrayConstructor
  • uint8_clamped: Uint8ClampedArrayConstructor

Functions

abs

add

arange

  • arange(start: number, stop: number, step: number, dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor): NdArray
  • arange(start: number, stop: number, step: number): NdArray
  • arange(start: number, stop: number, dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor): NdArray
  • arange(start: number, stop: number): NdArray
  • arange(stop: number, dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor): NdArray
  • arange(stop: number): NdArray
  • Return evenly spaced values within a given interval.

    Parameters

    • start: number

      Default 0 (int). Start of interval. The interval includes this value.

    • stop: number

      End of interval (int). The interval does not include this value.

    • step: number

      Default 1 (int). Spacing between values. The default step size is 1. If step is specified, start must also be given.

    • dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor

      Defaut is "array". The type of the output array. Either string (e.g. 'uint8') or a Constructor function (e.g. Uint8Array).

    Returns NdArray

  • Parameters

    • start: number
    • stop: number
    • step: number

    Returns NdArray

  • Parameters

    • start: number
    • stop: number
    • dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor

    Returns NdArray

  • Parameters

    • start: number
    • stop: number

    Returns NdArray

  • Parameters

    • stop: number
    • dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor

    Returns NdArray

  • Parameters

    • stop: number

    Returns NdArray

arccos

arcsin

arctan

Const array

broadcast

  • broadcast(shape1: number[], shape2: number[]): number[]

clip

concatenate

convolve

  • Convolve 2 N-dimensionnal arrays

    note:

    Arrays must have the same dimensions and a must be greater than b.

    note:

    The convolution product is only given for points where the signals overlap completely. Values outside the signal boundary have no effect. This behaviour is known as the 'valid' mode.

    Parameters

    Returns NdArray

cos

diag

divide

dot

empty

  • empty(shape: number | number[], dtype?: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor): NdArray
  • Return a new array of given shape and type, filled with undefined values.

    Parameters

    • shape: number | number[]

      Shape of the new array, e.g., [2, 3] or 2.

    • Optional dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor

      Defaut is "array". The type of the output array. E.g., 'uint8' or Uint8Array.

    Returns NdArray

    Array of undefined values with the given shape and dtype

equal

exp

fft

fftconvolve

  • Convolve 2 N-dimensionnal arrays using Fast Fourier Transform (FFT)

    note:

    Arrays must have the same dimensions and a must be greater than b.

    note:

    The convolution product is only given for points where the signals overlap completely. Values outside the signal boundary have no effect. This behaviour is known as the 'valid' mode.

    Parameters

    Returns NdArray

flatten

flip

  • Reverse the order of elements in an array along the given axis. The shape of the array is preserved, but the elements are reordered. New in version 0.15.0.

    Parameters

    Returns NdArray

    A view of m with the entries of axis reversed. Since a view is returned, this operation is done in constant time.

float32

float64

identity

  • identity(n: number, dtype?: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor): NdArray
  • The identity array is a square array with ones on the main diagonal.

    Parameters

    • n: number

      number of rows (and columns) in n x n output.

    • Optional dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor

      Defaut is "array". The type of the output array. E.g., 'uint8' or Uint8Array.

    Returns NdArray

    n x n array with its main diagonal set to one, and all other elements 0

ifft

int16

int32

int8

leakyRelu

log

max

mean

min

mod

multiply

ndarray

  • ndarray<D>(data: D, shape?: number[], stride?: number[], offset?: number): ndarray.NdArray<D>

negative

ones

  • ones(shape: number | number[], dtype?: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor): NdArray
  • Return a new array of given shape and type, filled with ones.

    Parameters

    • shape: number | number[]

      Shape of the new array, e.g., [2, 3] or 2.

    • Optional dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor

      Defaut is "array". The type of the output array. E.g., 'uint8' or Uint8Array.

    Returns NdArray

    Array of ones with the given shape and dtype

power

random

  • random(...shape: number[]): NdArray
  • random(shape?: number | number[]): NdArray
  • Create an array of the given shape and propagate it with random samples from a uniform distribution over [0, 1].

    Parameters

    • Rest ...shape: number[]

      The dimensions of the returned array, should all be positive integers

    Returns NdArray

  • Parameters

    • Optional shape: number | number[]

    Returns NdArray

Const remainder

reshape

  • Gives a new shape to an array without changing its data.

    Parameters

    • array: NdArray | ArbDimNumArray
    • shape: number | number[]

      The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length

    Returns NdArray

rot90

  • Rotate an array by 90 degrees in the plane specified by axes. Rotation direction is from the first towards the second axis. New in version 0.15.0.

    Parameters

    • m: NdArray | ArbDimNumArray

      array_like

    • k: number = 1

      Number of times the array is rotated by 90 degrees.

    • axes: number[] | NdArray = ...

      Default [0, 1]. The array is rotated in the plane defined by the axes. Axes must be different.

    Returns NdArray

    A rotated view of m.

round

sigmoid

sin

softmax

sqrt

stack

  • Join a sequence of arrays along a new axis. The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension.

    Parameters

    • arrays: (number | NdArray | ArbDimNumArray)[]

      Sequence of array_like

    • axis: number = 0

      The axis in the result array along which the input arrays are stacked.

    Returns NdArray

    The stacked array has one more dimension than the input arrays.

std

  • Returns the standard deviation, a measure of the spread of a distribution, of the input array elements.

    Parameters

    Returns number

subtract

sum

tan

tanh

transpose

uint16

uint32

uint8

uint8Clamped

zeros

  • zeros(shape: number | number[], dtype?: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor): NdArray
  • Return a new array of given shape and type, filled with zeros.

    Parameters

    • shape: number | number[]

      Shape of the new array, e.g., [2, 3] or 2.

    • Optional dtype: "array" | "int8" | "uint8" | "uint8_clamped" | "int16" | "uint16" | "int32" | "uint32" | "float32" | "float64" | ArrayLikeConstructor

      Defaut is "array". The type of the output array. E.g., 'uint8' or Uint8Array.

    Returns NdArray

Generated using TypeDoc