Skip to content

Commit 101df02

Browse files
committed
fix: update README
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent df82ec0 commit 101df02

File tree

1 file changed

+12
-15
lines changed
  • lib/node_modules/@stdlib/stats/base/nanmin-by

1 file changed

+12
-15
lines changed

lib/node_modules/@stdlib/stats/base/nanmin-by/README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2025 The Stdlib Authors.
5+
Copyright (c) 2020 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ var nanminBy = require( '@stdlib/stats/base/nanmin-by' );
3232

3333
#### nanminBy( N, x, strideX, clbk\[, thisArg] )
3434

35-
Calculates the minimum value of strided array `x` via a callback function, ignoring `NaN` values.
35+
Computes the minimum value of a strided array via a callback function, ignoring `NaN` values.
3636

3737
```javascript
3838
function accessor( v ) {
@@ -49,7 +49,7 @@ The function has the following parameters:
4949

5050
- **N**: number of indexed elements.
5151
- **x**: input [`Array`][mdn-array], [`typed array`][mdn-typed-array], or an array-like object (excluding strings and functions).
52-
- **strideX**: index increment.
52+
- **strideX**: stride length.
5353
- **clbk**: callback function.
5454
- **thisArg**: execution context (_optional_).
5555

@@ -81,27 +81,23 @@ var cnt = context.count;
8181
// returns 10
8282
```
8383

84-
The `N` and `strideX` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element
84+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element
8585

8686
```javascript
87-
var floor = require( '@stdlib/math/base/special/floor' );
88-
8987
function accessor( v ) {
9088
return v * 2.0;
9189
}
9290

9391
var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0, NaN, NaN ];
94-
var N = floor( x.length / 2 );
9592

96-
var v = nanminBy( N, x, 2, accessor );
93+
var v = nanminBy( 5, x, 2, accessor );
9794
// returns -4.0
9895
```
9996

10097
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
10198

10299
```javascript
103100
var Float64Array = require( '@stdlib/array/float64' );
104-
var floor = require( '@stdlib/math/base/special/floor' );
105101

106102
function accessor( v ) {
107103
return v * 2.0;
@@ -112,16 +108,15 @@ var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
112108

113109
// Create an offset view...
114110
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
115-
var N = floor( x0.length/2 );
116111

117112
// Access every other element...
118-
var v = nanminBy( N, x1, 2, accessor );
113+
var v = nanminBy( 3, x1, 2, accessor );
119114
// returns -12.0
120115
```
121116

122117
#### nanminBy.ndarray( N, x, strideX, offsetX, clbk\[, thisArg] )
123118

124-
Calculates the minimum value of strided array `x` via a callback function, ignoring `NaN` values and using alternative indexing semantics.
119+
Computes the minimum value of a strided array via a callback function, ignoring `NaN` values and using alternative indexing semantics.
125120

126121
```javascript
127122
function accessor( v ) {
@@ -138,7 +133,7 @@ The function has the following additional parameters:
138133

139134
- **offsetX**: starting index.
140135

141-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x`
136+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x`
142137

143138
```javascript
144139
function accessor( v ) {
@@ -183,10 +178,10 @@ var bernoulli = require( '@stdlib/random/base/bernoulli' );
183178
var nanminBy = require( '@stdlib/stats/base/nanmin-by' );
184179

185180
function rand() {
186-
if( bernoulli( 0.8 ) < 1 ) {
181+
if ( bernoulli( 0.8 )< 0.2 ) {
187182
return NaN;
188183
}
189-
return uniform( -50.0, 50.0 );
184+
return uniform( -50, 50 );
190185
}
191186

192187
function accessor( v ) {
@@ -230,6 +225,8 @@ console.log( v );
230225

231226
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
232227

228+
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor
229+
233230
<!-- <related-links> -->
234231

235232
[@stdlib/stats/strided/dnanmin]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/dnanmin

0 commit comments

Comments
 (0)