W3cubDocs

/Nushell

histogram for chart

Creates a new table with a histogram based on the column name passed in.

Signature

> histogram {flags} (column-name) (frequency-column-name)

Flags

  • --percentage-type, -t {string}: percentage calculate method, can be 'normalize' or 'relative', in 'normalize', defaults to be 'normalize'

Parameters

  • column-name: column name to calc frequency, no need to provide if input is just a list
  • frequency-column-name: histogram's frequency column, default to be frequency column output

Input/output types:

input output
list<any> table

Examples

Compute a histogram of file types

>ls|histogramtype

Compute a histogram for the types of files, with frequency column named freq

>ls|histogramtypefreq

Compute a histogram for a list of numbers

> [121] |histogram
╭────┬────────┬────────┬──────────┬────────────┬────────────────────────────────────────────────────────────────────╮
# │ value  │ count  │ quantile │ percentage │                             frequency                              │
├────┼────────┼────────┼──────────┼────────────┼────────────────────────────────────────────────────────────────────┤
0120.6766.67%******************************************************************
1210.3333.33%*********************************
╰────┴────────┴────────┴──────────┴────────────┴────────────────────────────────────────────────────────────────────╯

Compute a histogram for a list of numbers, and percentage is based on the maximum value

> [1231112211] |histogram--percentage-typerelative

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/histogram.html