10000 GitHub - stdlib-js/array-base-onesnd at 562ca73f126e14e5ef6f79f01f42ba71a905a86d
[go: up one dir, main page]

Skip to content

stdlib-js/array-base-onesnd

Repository files navigation

onesnd

NPM version Build Status Coverage Status

Create an n-dimensional nested array filled with ones.

Installation

npm install @stdlib/array-base-onesnd

Alternatively,

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

Usage

var onesnd = require( '@stdlib/array-base-onesnd' );

onesnd( shape )

Returns an n-dimensional nested array filled with ones.

var out = onesnd( [ 2, 3 ] );
// returns [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ]

Examples

var onesnd = require( '@stdlib/array-base-onesnd' );

var out = onesnd( [ 1, 3 ] );
// returns [ [ 1.0, 1.0, 1.0 ] ]

out = onesnd( [ 3, 1 ] );
// returns [ [ 1.0 ], [ 1.0 ], [ 1.0 ] ]

out = onesnd( [ 1, 1, 3 ] );
// returns [ [ [ 1.0, 1.0, 1.0 ] ] ]

out = onesnd( [ 1, 3, 1 ] );
// returns [ [ [ 1.0 ], [ 1.0 ], [ 1.0 ] ] ]

out = onesnd( [ 1, 1, 1, 3 ] );
// returns [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ]

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2023. The Stdlib Authors.

0