Skip to content

Commit 61519e1

Browse files
committed
Auto-generated commit
1 parent 5c46977 commit 61519e1

4 files changed

Lines changed: 14 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-02-18)
7+
## Unreleased (2026-02-26)
88

99
<section class="issues">
1010

1111
### Closed Issues
1212

13-
This release closes the following issue:
13+
A total of 2 issues were closed in this release:
1414

15-
[#10327](https://github.com/stdlib-js/stdlib/issues/10327)
15+
[#10327](https://github.com/stdlib-js/stdlib/issues/10327), [#10423](https://github.com/stdlib-js/stdlib/issues/10423)
1616

1717
</section>
1818

@@ -24,6 +24,7 @@ This release closes the following issue:
2424

2525
<details>
2626

27+
- [`9687965`](https://github.com/stdlib-js/stdlib/commit/96879652e1c3ee69d36d5abcc6296b4830bee4a9) - **chore:** address commit comments for commit `8b01d81` [(#10433)](https://github.com/stdlib-js/stdlib/pull/10433) _(by Daniel Mungai Chege)_
2728
- [`8b01d81`](https://github.com/stdlib-js/stdlib/commit/8b01d81e8346ac3e4795b7d79a51902e201b2b98) - **chore:** fix JavaScript lint errors [(#10331)](https://github.com/stdlib-js/stdlib/pull/10331) _(by Bhargav Dabhade)_
2829

2930
</details>
@@ -36,9 +37,10 @@ This release closes the following issue:
3637

3738
### Contributors
3839

39-
A total of 1 person contributed to this release. Thank you to this contributor:
40+
A total of 2 people contributed to this release. Thank you to the following contributors:
4041

4142
- Bhargav Dabhade
43+
- Daniel Mungai Chege
4244

4345
</section>
4446

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,13 @@ The returned frequency table is an `array` of `arrays`. Each sub-array correspon
160160
<!-- eslint no-undef: "error" -->
161161

162162
```javascript
163-
var randu = require( '@stdlib/random-base-randu' );
164-
var floor = require( '@stdlib/math-base-special-floor' );
163+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
164+
var take = require( '@stdlib/array-take' );
165165
var tabulateBy = require( '@stdlib/utils-tabulate-by' );
166166

167167
var vals;
168168
var arr;
169169
var out;
170-
var i;
171-
var j;
172170

173171
function indicator( value ) {
174172
return value[ 0 ];
@@ -177,11 +175,7 @@ function indicator( value ) {
177175
vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ];
178176

179177
// Generate a random collection...
180-
arr = [];
181-
for ( i = 0; i < 100; i++ ) {
182-
j = floor( randu()*vals.length );
183-
arr.push( vals[ j ] );
184-
}
178+
arr = take( vals, discreteUniform( 100, 0, vals.length - 1 ) );
185179

186180
// Generate a frequency table:
187181
out = tabulateBy( arr, indicator );

examples/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random-base-randu' );
22-
var floor = require( '@stdlib/math-base-special-floor' );
21+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
22+
var take = require( '@stdlib/array-take' );
2323
var tabulateBy = require( './../lib' );
2424

2525
var vals;
2626
var arr;
2727
var out;
28-
var i;
29-
var j;
3028

3129
function indicator( value ) {
3230
return value[ 0 ];
@@ -35,11 +33,7 @@ function indicator( value ) {
3533
vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ];
3634

3735
// Generate a random collection...
38-
arr = [];
39-
for ( i = 0; i < 100; i++ ) {
40-
j = floor( randu()*vals.length );
41-
arr.push( vals[ j ] );
42-
}
36+
arr = take( vals, discreteUniform( 100, 0, vals.length - 1 ) );
4337

4438
// Generate a frequency table:
4539
out = tabulateBy( arr, indicator );

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@
4848
},
4949
"devDependencies": {
5050
"@stdlib/array-float64": "^0.2.3",
51+
"@stdlib/array-take": "^0.1.3",
5152
"@stdlib/assert-is-array": "^0.2.3",
5253
"@stdlib/math-base-special-floor": "^0.2.4",
5354
"@stdlib/math-base-special-pow": "^0.3.1",
55+
"@stdlib/random-array-discrete-uniform": "^0.2.2",
5456
"@stdlib/random-base-randu": "^0.2.3",
5557
"@stdlib/utils-noop": "^0.2.3",
5658
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",

0 commit comments

Comments
 (0)