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 min for math

Finds the minimum within a list of values or tables.

Signature

> math min {flags} ...rest

Parameters

  • ...rest: The cell-paths/columns to operate on.

Input/output types:

inputoutput
list<number>number
list<duration>duration
list<filesize>filesize
list<any>any
rangenumber
tablerecord
recordrecord

Examples

Compute the minimum of a list of numbers.

> [-50 100 25] | math min
-50

Compute the minima of the columns of a table.

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

Find the minimum of a list of arbitrary values (Warning: Weird).

> [-50 'hello' true] | math min
true

Compute the minimum of list-valued columns in a record.

> {alice: [5 3 9], bob: [2 7]} | math min
╭───────┬───╮
│ alice │ 3 │
│ bob   │ 2 │
╰───────┴───╯

Compute the minimum of a single column using a cell path.

> {alice: [5 3 9], bob: [2 7]} | math min alice
╭───────┬───────────╮
│ alice │ 3         │
│       │ ╭───┬───╮ │
│ bob   │ │ 0 │ 2 │ │
│       │ │ 1 │ 7 │ │
│       │ ╰───┴───╯ │
╰───────┴───────────╯