Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

math mode for math

Returns the most frequent element(s) from a list of numbers or tables.

Signature

> math mode {flags}

Input/output types:

inputoutput
list<number>list<number>
list<duration>list<duration>
list<filesize>list<filesize>
tablerecord

Examples

Compute the mode(s) of a list of numbers

> [3 3 9 12 12 15] | math mode
╭───┬────╮
│ 0 │  3 │
│ 1 │ 12 │
╰───┴────╯

Compute the mode(s) of the columns of a table

> [{a: 1 b: 3} {a: 2 b: -1} {a: 1 b: 5}] | math mode
╭───┬────────────╮
│   │ ╭───┬───╮  │
│ a │ │ 0 │ 1 │  │
│   │ ╰───┴───╯  │
│   │ ╭───┬────╮ │
│ b │ │ 0 │ -1 │ │
│   │ │ 1 │  3 │ │
│   │ │ 2 │  5 │ │
│   │ ╰───┴────╯ │
╰───┴────────────╯