Skip to content

Commit 7c954e7

Browse files
committed
fix: sync js examples in 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent f420a27 commit 7c954e7

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

  • lib/node_modules/@stdlib/stats/strided/dnancumax

lib/node_modules/@stdlib/stats/strided/dnancumax/README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,20 @@ dnancumax.ndarray( 4, x, 2, 1, y, -1, y.length-1 );
143143
<!-- eslint no-undef: "error" -->
144144

145145
```javascript
146-
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
146+
var uniform = require( '@stdlib/random/base/uniform' );
147+
var bernoulli = require( '@stdlib/random/base/bernoulli' );
148+
var filledarrayBy = require( '@stdlib/array/filled-by' );
147149
var Float64Array = require( '@stdlib/array/float64' );
148150
var dnancumax = require( '@stdlib/stats/strided/dnancumax' );
149151

150-
var x = discreteUniform( 10, -50, 50, {
151-
'dtype': 'float64'
152-
});
153-
x[ 3 ] = NaN;
154-
x[ 7 ] = NaN;
152+
function rand() {
153+
if ( bernoulli( 0.2 ) < 1 ) {
154+
return NaN;
155+
}
156+
return uniform( -50.0, 50.0 );
157+
}
158+
159+
var x = filledarrayBy( 10, 'float64', rand );
155160
console.log( x );
156161

157162
var y = new Float64Array( x.length );

0 commit comments

Comments
 (0)