You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The specified output [ndarray][@stdlib/ndarray/ctor]`shape` may be either an array-like object or an integer value.
61
+
The specified output [ndarray][@stdlib/ndarray/ctor] shape may be either an array-like object or an integer value.
59
62
60
63
```javascript
64
+
var getShape =require( '@stdlib/ndarray/shape' );
65
+
var getDType =require( '@stdlib/ndarray/dtype' );
66
+
61
67
var arr =zeros( 2 );
62
-
// returns <ndarray>
68
+
// returns <ndarray>[ 0.0, 0.0 ]
63
69
64
-
var sh =arr.shape;
70
+
var sh =getShape( arr );
65
71
// returns [ 2 ]
66
72
67
-
var dt =arr.dtype;
73
+
var dt =String( getDType( arr ) );
68
74
// returns 'float64'
69
75
```
70
76
71
-
The function accepts the following `options`:
77
+
The function accepts the following options:
72
78
73
-
-**dtype**: underlying [data type][@stdlib/ndarray/dtypes]. Must be a numeric [data type][@stdlib/ndarray/dtypes] or "generic". Default: `'float64'`.
79
+
-**dtype**: underlying [data type][@stdlib/ndarray/dtypes]. Must be a numeric or "generic" [data type][@stdlib/ndarray/dtypes]. Default: `'float64'`.
74
80
-**order**: specifies whether an [ndarray][@stdlib/ndarray/ctor] is `'row-major'` (C-style) or `'column-major'` (Fortran-style). Default: `'row-major'`.
75
-
-**mode**: specifies how to handle indices which exceed array dimensions (see [`ndarray`][@stdlib/ndarray/ctor]). Default: `'throw'`.
76
-
-**submode**: a mode array which specifies for each dimension how to handle subscripts which exceed array dimensions (see [`ndarray`][@stdlib/ndarray/ctor]). If provided fewer modes than dimensions, the constructor recycles modes using modulo arithmetic. Default: `[ options.mode ]`.
77
-
-**readonly**: `boolean` indicating whether an array should be **read-only**. Default: `false`.
81
+
-**mode**: specifies how to handle indices which exceed array dimensions (see [ndarray][@stdlib/ndarray/ctor]). Default: `'throw'`.
82
+
-**submode**: a mode array which specifies for each dimension how to handle subscripts which exceed array dimensions (see [ndarray][@stdlib/ndarray/ctor]). If provided fewer modes than dimensions, the constructor recycles modes using modulo arithmetic. Default: `[ options.mode ]`.
83
+
-**readonly**: boolean indicating whether an array should be **read-only**. Default: `false`.
78
84
79
85
By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [`float64`][@stdlib/ndarray/dtypes] data type. To specify an alternative [data type][@stdlib/ndarray/dtypes], provide a `dtype` option.
0 commit comments