histogram ( seq -- hashtable )

Statistics ยป Computing histograms

Statistics ยป Computing histograms

Next: | histogram-by ( seq quot: ( x -- bin ) -- hashtable ) |

Vocabulary

math.statistics

Inputs

Outputs

Word description

Returns a hashtable where the keys are the elements of the sequence and the values are the number of times they appeared in that sequence.

Examples

Definition

math.statistics

Inputs

seq | a sequence |

Outputs

hashtable | a hashtable |

Word description

Returns a hashtable where the keys are the elements of the sequence and the values are the number of times they appeared in that sequence.

Examples

! Count the number of times an element appears in a sequence.
USING: prettyprint math.statistics ;
"aaabc" histogram .

H{ { 97 3 } { 98 1 } { 99 1 } }

H{ { 97 3 } { 98 1 } { 99 1 } }

Definition

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.101 x86.64 (2284, heads/master-4a32b2801d, Nov 5 2024 16:06:40)