Create an array filled entirely with ones.
Numeric.create.one(shape)Builds an array filled with ones.
- Parameters:
shape: Target dimensions of the created array
- Returns: Array filled with ones
- NumPy: Covers
np.ones,np.ones_likethrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const values = Numeric.create.one([3])
console.log(values)
// [1,1,1]import Numeric from '@neabyte/numerix'
const matrix = Numeric.create.one([2, 2])
console.log(matrix)
// [[1,1],[1,1]]import Numeric from '@neabyte/numerix'
const matrix = Numeric.create.one([2, 3])
console.log(matrix)
// [[1,1,1],[1,1,1]]import Numeric from '@neabyte/numerix'
const values = Numeric.create.one([1])
console.log(values)
// [1]