time-to-botec/js/node_modules/@stdlib/utils/tabulate/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

34 lines
869 B
Plaintext

{{alias}}( collection )
Generates a frequency table.
The table is an array of arrays where each sub-array corresponds to a unique
value in the input collection. Each sub-array is structured as follows:
- 0: unique value
- 1: value count
- 2: frequency percentage
If provided an empty collection, the function returns an empty array.
Parameters
----------
collection: Array|TypedArray|Object
Input collection to tabulate. If provided an object, the object must be
array-like (excluding strings and functions).
Returns
-------
out: Array<Array>|Array
Frequency table.
Examples
--------
> var collection = [ 'beep', 'boop', 'foo', 'beep' ];
> var out = {{alias}}( collection )
[ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ]
See Also
--------