hashBucket

Syntax

hashBucket(X, buckets)

Arguments

X is a scalar/vector.

buckets is a positive integer.

Details

Hashes each element in X into one of the specified number of buckets and returns the corresponding bucket index.

Examples

hashBucket(34 45 67, 10);
// output: [4,5,7]

hashBucket(`AAPL`TSLA`GS`MS`GE`BA`UAL`WMT, 10);
// output: [9,4,1,8,3,7,5,2]