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: nanmax-by/README.md
+12-44Lines changed: 12 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,7 @@ function clbk( v ) {
44
44
}
45
45
46
46
var y =nanmaxBy( x, clbk );
47
-
// returns <ndarray>
48
-
49
-
var v =y.get();
50
-
// returns 4.0
47
+
// returns <ndarray>[ 4.0 ]
51
48
```
52
49
53
50
The function has the following parameters:
@@ -81,10 +78,7 @@ var ctx = {
81
78
'count':0
82
79
};
83
80
var y =nanmaxBy( x, clbk, ctx );
84
-
// returns <ndarray>
85
-
86
-
var v =y.get();
87
-
// returns 4.0
81
+
// returns <ndarray>[ 4.0 ]
88
82
89
83
var count =ctx.count;
90
84
// returns 3
@@ -99,7 +93,6 @@ The function accepts the following options:
99
93
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.
100
94
101
95
```javascript
102
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
103
96
var array =require( '@stdlib/ndarray/array' );
104
97
105
98
functionclbk( v ) {
@@ -110,41 +103,30 @@ var x = array( [ -1.0, 2.0, NaN, 4.0 ], {
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`.
145
128
146
129
```javascript
147
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
148
130
var array =require( '@stdlib/ndarray/array' );
149
131
150
132
functionclbk( v ) {
@@ -155,39 +137,28 @@ var x = array( [ -1.0, 2.0, NaN, 4.0 ], {
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.
@@ -208,7 +179,7 @@ var opts = {
208
179
'dtype':'float64'
209
180
};
210
181
var y =nanmaxBy( x, opts, clbk );
211
-
// returns <ndarray>
182
+
// returns <ndarray>[ 200.0 ]
212
183
213
184
var dt =String( getDType( y ) );
214
185
// returns 'float64'
@@ -230,10 +201,7 @@ var x = array( [ -1.0, 2.0, NaN ] );
Copy file name to clipboardExpand all lines: nanmax-by/docs/types/index.d.ts
+6-24Lines changed: 6 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -124,10 +124,7 @@ interface Unary {
124
124
* var x = array( [ -1.0, 2.0, NaN ] );
125
125
*
126
126
* var y = nanmaxBy( x, clbk );
127
-
* // returns <ndarray>
128
-
*
129
-
* var v = y.get();
130
-
* // returns 4.0
127
+
* // returns <ndarray>[ 4.0 ]
131
128
*/
132
129
<T=unknown,UextendsInputArray<T>=InputArray<T>,ThisArg=unknown>(x: U,clbk: Callback<T,U,ThisArg>,thisArg?: ThisParameterType<Callback<T,U,ThisArg>>): OutputArray<number>;// NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output ndarray data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`.
133
130
@@ -150,10 +147,7 @@ interface Unary {
150
147
* var x = array( [ -1.0, 2.0, NaN ] );
151
148
*
152
149
* var y = nanmaxBy( x, {}, clbk );
153
-
* // returns <ndarray>
154
-
*
155
-
* var v = y.get();
156
-
* // returns 4.0
150
+
* // returns <ndarray>[ 4.0 ]
157
151
*/
158
152
<T=unknown,UextendsInputArray<T>=InputArray<T>,ThisArg=unknown>(x: U,options: Options,clbk: Callback<T,U,ThisArg>,thisArg?: ThisParameterType<Callback<T,U,ThisArg>>): OutputArray<number>;// NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output ndarray data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`.
0 commit comments