Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: address commit comments for commit 8b01d81
  • Loading branch information
MANDEep22332 committed Feb 26, 2026
commit d4496fceaace0b8b9c1b1ee43de81b16a07f6524
8 changes: 6 additions & 2 deletions lib/node_modules/@stdlib/utils/tabulate-by/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

'use strict';


var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var take = require( '@stdlib/array/take' );
var tabulateBy = require( './../lib' );
Expand All @@ -32,8 +33,11 @@ function indicator( value ) {

vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ];

// Generate a random collection...
arr = take( vals, discreteUniform( 100, 0, vals.length - 1 ) );
// Generate random indices:
var idx = discreteUniform( 100, 0, vals.length-1 );

// Select values:
arr = take( vals, idx );

// Generate a frequency table:
out = tabulateBy( arr, indicator );
Expand Down