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

Returns the square root of the input number.

Signature

> math sqrt {flags} ...rest

Parameters

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

Input/output types:

inputoutput
numberfloat
list<number>list<float>
rangelist<number>
recordrecord

Examples

Compute the square root of each number in a list.

> [9 16] | math sqrt
╭───┬──────╮
│ 0 │ 3.00 │
│ 1 │ 4.00 │
╰───┴──────╯

Apply square root to list-valued columns in a record.

> {alice: [1 4 9], bob: [16 25 36]} | math sqrt
╭───────┬──────────────╮
│       │ ╭───┬──────╮ │
│ alice │ │ 0 │ 1.00 │ │
│       │ │ 1 │ 2.00 │ │
│       │ │ 2 │ 3.00 │ │
│       │ ╰───┴──────╯ │
│       │ ╭───┬──────╮ │
│ bob   │ │ 0 │ 4.00 │ │
│       │ │ 1 │ 5.00 │ │
│       │ │ 2 │ 6.00 │ │
│       │ ╰───┴──────╯ │
╰───────┴──────────────╯

Apply square root to a single column using a cell path.

> {alice: [1 4 9], bob: [16 25 36]} | math sqrt alice
╭───────┬──────────────╮
│       │ ╭───┬──────╮ │
│ alice │ │ 0 │ 1.00 │ │
│       │ │ 1 │ 2.00 │ │
│       │ │ 2 │ 3.00 │ │
│       │ ╰───┴──────╯ │
│       │ ╭───┬────╮   │
│ bob   │ │ 0 │ 16 │   │
│       │ │ 1 │ 25 │   │
│       │ │ 2 │ 36 │   │
│       │ ╰───┴────╯   │
╰───────┴──────────────╯