input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'float64'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float32'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float32'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'float32'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'complex128'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'complex128'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'complex128'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'complex64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'complex64'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'complex64'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'int32'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'int32'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int32'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'int16'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'int16'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int16'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'int8'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'int8'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int8'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'uint32'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'uint32'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint32'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'uint16'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'uint16'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint16'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'uint8'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'uint8'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint8'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'uint8c'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'uint8c'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint8c'
Creates a zero-filled double-precision floating-point array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'generic'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'generic'
var y = zerosLike( x, {
'dtype': 'float64'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'float64'
Creates a zero-filled single-precision floating-point array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'float32'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'float32'
Creates a zero-filled double-precision complex floating-point array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'complex128'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'complex128'
Creates a zero-filled single-precision complex floating-point array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'complex64'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'complex64'
Creates a zero-filled 32-bit signed integer array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'int32'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int32'
Creates a zero-filled 16-bit signed integer array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'int16'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int16'
Creates a zero-filled 8-bit signed integer array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'int8'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int8'
Creates a zero-filled 32-bit unsigned integer array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'uint32'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint32'
Creates a zero-filled 16-bit unsigned integer array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'uint16'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint16'
Creates a zero-filled 8-bit unsigned integer array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'uint8'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint8'
Creates a zero-filled clamped 8-bit unsigned integer array having the same shape as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x, {
'dtype': 'uint8c'
});
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint8c'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
options
zero-filled array
var zeros = require( `@stdlib/ndarray/zeros` );
var x = zeros( [ 2, 2 ], {
'dtype': 'float64'
});
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'generic'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'generic'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.