Skip to content

Commit 8be43b3

Browse files
authored
docs: update examples in stats/mean
PR-URL: #8823 Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 48d0dcb commit 8be43b3

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

lib/node_modules/@stdlib/stats/mean/README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,13 @@ The method accepts the following options:
230230
<!-- eslint no-undef: "error" -->
231231

232232
```javascript
233-
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
233+
var uniform = require( '@stdlib/random/uniform' );
234234
var getDType = require( '@stdlib/ndarray/dtype' );
235235
var ndarray2array = require( '@stdlib/ndarray/to-array' );
236-
var ndarray = require( '@stdlib/ndarray/ctor' );
237236
var mean = require( '@stdlib/stats/mean' );
238237

239238
// Generate an array of random numbers:
240-
var xbuf = discreteUniform( 25, 0, 20, {
241-
'dtype': 'generic'
242-
});
243-
244-
// Wrap in an ndarray:
245-
var x = new ndarray( 'generic', xbuf, [ 5, 5 ], [ 5, 1 ], 0, 'row-major' );
239+
var x = uniform( [ 5, 5 ], 0.0, 20.0 );
246240
console.log( ndarray2array( x ) );
247241

248242
// Perform a reduction:

lib/node_modules/@stdlib/stats/mean/examples/index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,13 @@
1818

1919
'use strict';
2020

21-
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
21+
var uniform = require( '@stdlib/random/uniform' );
2222
var getDType = require( '@stdlib/ndarray/dtype' );
2323
var ndarray2array = require( '@stdlib/ndarray/to-array' );
24-
var ndarray = require( '@stdlib/ndarray/ctor' );
2524
var mean = require( './../lib' );
2625

2726
// Generate an array of random numbers:
28-
var xbuf = discreteUniform( 25, 0, 20, {
29-
'dtype': 'generic'
30-
});
31-
32-
// Wrap in an ndarray:
33-
var x = new ndarray( 'generic', xbuf, [ 5, 5 ], [ 5, 1 ], 0, 'row-major' );
27+
var x = uniform( [ 5, 5 ], 0.0, 20.0 );
3428
console.log( ndarray2array( x ) );
3529

3630
// Perform a reduction:

0 commit comments

Comments
 (0)