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
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/stats/mskmax/README.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,10 +35,11 @@ var mskmax = require( '@stdlib/stats/mskmax' );
35
35
Compute the maximum value along one or more [ndarray][@stdlib/ndarray/ctor] dimensions according to a mask.
36
36
37
37
```javascript
38
+
varUint8Array=require( '@stdlib/array/uint8' );
38
39
var array =require( '@stdlib/ndarray/array' );
39
40
40
41
var x =array( [ -1.0, 2.0, -3.0 ] );
41
-
var mask =array( [ 0, 0, 1 ] );
42
+
var mask =array( newUint8Array( [ 0, 0, 1 ] ) );
42
43
43
44
var y =mskmax( x, mask );
44
45
// returns <ndarray>
@@ -62,14 +63,15 @@ The function accepts the following options:
62
63
By default, the function performs a reduction over all elements in a provided input [ndarray][@stdlib/ndarray/ctor]. To perform a reduction over specific dimensions, provide a `dims` option.
63
64
64
65
```javascript
66
+
var mskmax =require( '@stdlib/stats/mskmax' );
65
67
var ndarray2array =require( '@stdlib/ndarray/to-array' );
By default, the function excludes reduced dimensions from the output [ndarray][@stdlib/ndarray/ctor]. To include the reduced dimensions as singleton dimensions, set the `keepdims` option to `true`.
105
107
106
108
```javascript
109
+
var mskmax =require( '@stdlib/stats/mskmax' );
107
110
var ndarray2array =require( '@stdlib/ndarray/to-array' );
By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [data type][@stdlib/ndarray/dtypes] determined by the function's output data type [policy][@stdlib/ndarray/output-dtype-policies]. To override the default behavior, set the `dtype` option.
151
154
152
155
```javascript
156
+
var mskmax =require( '@stdlib/stats/mskmax' );
153
157
var getDType =require( '@stdlib/ndarray/dtype' );
154
158
var array =require( '@stdlib/ndarray/array' );
155
159
156
160
var x =array( [ -1.0, 2.0, -3.0 ], {
157
161
'dtype':'generic'
158
162
});
159
-
var mask =array( [ 0, 0, 1 ] );
163
+
var mask =array( newUint8Array( [ 0, 0, 1 ] ) );
160
164
161
165
var y =mskmax( x, mask, {
162
166
'dtype':'float64'
@@ -172,11 +176,12 @@ var dt = String( getDType( y ) );
172
176
Computes the maximum value of [ndarray][@stdlib/ndarray/ctor] along one or more dimensions and assigns results to a provided output [ndarray][@stdlib/ndarray/ctor] according to mask.
0 commit comments