Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 977 Bytes

empty.md

File metadata and controls

62 lines (40 loc) · 977 Bytes

empty

Create an array with the requested shape filled with zeros.

API

Numeric.create.empty(shape)

Builds an array with the requested dimensions.

  • Parameters:
    • shape: Target dimensions of the created array
  • Returns: Array with the requested shape
  • NumPy: Covers np.empty, np.empty_like through a single Numerix method.

Examples

Empty matrix

import Numeric from '@neabyte/numerix'

const matrix = Numeric.create.empty([2, 3])

console.log(matrix)
// [[0,0,0],[0,0,0]]

Empty vector

import Numeric from '@neabyte/numerix'

const values = Numeric.create.empty([4])

console.log(values)
// [0,0,0,0]

Empty square matrix

import Numeric from '@neabyte/numerix'

const matrix = Numeric.create.empty([2, 2])

console.log(matrix)
// [[0,0],[0,0]]

Empty array with one row

import Numeric from '@neabyte/numerix'

const matrix = Numeric.create.empty([1, 2])

console.log(matrix)
// [[0,0]]