mirror of
https://github.com/nushell/nushell.git
synced 2025-01-24 07:09:02 +01:00
delete docs/commands (#4851)
This commit is contained in:
parent
cb5d997adf
commit
65baeaecd4
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: alias
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Alias a command (with optional flags) to a new name
|
||||
|
||||
## Signature
|
||||
|
||||
```> alias (name) (initial_value)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `name`: name of the alias
|
||||
- `initial_value`: equals sign followed by value
|
||||
|
||||
## Examples
|
||||
|
||||
Alias ll to ls -l
|
||||
```shell
|
||||
> alias ll = ls -l
|
||||
```
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: all?
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Test if every element of the input matches a predicate.
|
||||
|
||||
## Signature
|
||||
|
||||
```> all? (predicate)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `predicate`: the predicate that must match
|
||||
|
||||
## Examples
|
||||
|
||||
Find if services are running
|
||||
```shell
|
||||
> echo [[status]; [UP] [UP]] | all? status == UP
|
||||
```
|
||||
|
||||
Check that all values are even
|
||||
```shell
|
||||
> echo [2 4 6 8] | all? ($it mod 2) == 0
|
||||
```
|
@ -1,45 +0,0 @@
|
||||
---
|
||||
title: ansi
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Output ANSI codes to change color.
|
||||
|
||||
## Signature
|
||||
|
||||
```> ansi (code) --escape --osc --list```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `code`: the name of the code to use like 'green' or 'reset' to reset the color
|
||||
- `--escape`: escape sequence without the escape character(s)
|
||||
- `--osc`: operating system command (ocs) escape sequence without the escape character(s)
|
||||
- `--list`: list available ansi code names
|
||||
|
||||
## Examples
|
||||
|
||||
Change color to green
|
||||
```shell
|
||||
> ansi green
|
||||
```
|
||||
|
||||
Reset the color
|
||||
```shell
|
||||
> ansi reset
|
||||
```
|
||||
|
||||
Use ansi to color text (rb = red bold, gb = green bold, pb = purple bold)
|
||||
```shell
|
||||
> echo [(ansi rb) Hello " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str collect
|
||||
```
|
||||
|
||||
Use ansi to color text (italic bright yellow on red 'Hello' with green bold 'Nu' and purple bold 'World')
|
||||
```shell
|
||||
> echo [(ansi -e '3;93;41m') Hello (ansi reset) " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str collect
|
||||
```
|
||||
|
||||
Use ansi to color text with a style (blue on red in bold)
|
||||
```shell
|
||||
> $"(ansi -e { fg: '#0000ff' bg: '#ff0000' attr: b })Hello Nu World(ansi reset)"
|
||||
```
|
@ -1,41 +0,0 @@
|
||||
---
|
||||
title: ansi gradient
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
draw text with a provided start and end code making a gradient
|
||||
|
||||
## Signature
|
||||
|
||||
```> ansi gradient ...column path --fgstart --fgend --bgstart --bgend```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `...column path`: optionally, draw gradients using text from column paths
|
||||
- `--fgstart {string}`: foreground gradient start color in hex (0x123456)
|
||||
- `--fgend {string}`: foreground gradient end color in hex
|
||||
- `--bgstart {string}`: background gradient start color in hex
|
||||
- `--bgend {string}`: background gradient end color in hex
|
||||
|
||||
## Examples
|
||||
|
||||
draw text in a gradient with foreground start and end colors
|
||||
```shell
|
||||
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff --fgend 0xe81cff
|
||||
```
|
||||
|
||||
draw text in a gradient with foreground start and end colors and background start and end colors
|
||||
```shell
|
||||
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff --fgend 0xe81cff --bgstart 0xe81cff --bgend 0x40c9ff
|
||||
```
|
||||
|
||||
draw text in a gradient by specifying foreground start color - end color is assumed to be black
|
||||
```shell
|
||||
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff
|
||||
```
|
||||
|
||||
draw text in a gradient by specifying foreground end color - start color is assumed to be black
|
||||
```shell
|
||||
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgend 0xe81cff
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: ansi strip
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
strip ansi escape sequences from string
|
||||
|
||||
## Signature
|
||||
|
||||
```> ansi strip ...column path```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `...column path`: optionally, remove ansi sequences by column paths
|
||||
|
||||
## Examples
|
||||
|
||||
strip ansi escape sequences from string
|
||||
```shell
|
||||
> echo [ (ansi green) (ansi cursor_on) "hello" ] | str collect | ansi strip
|
||||
```
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: any?
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Tests if any element of the input matches a predicate.
|
||||
|
||||
## Signature
|
||||
|
||||
```> any? (predicate)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `predicate`: the predicate that must match
|
||||
|
||||
## Examples
|
||||
|
||||
Find if a service is not running
|
||||
```shell
|
||||
> echo [[status]; [UP] [DOWN] [UP]] | any? status == DOWN
|
||||
```
|
||||
|
||||
Check if any of the values is odd
|
||||
```shell
|
||||
> echo [2 4 1 6 8] | any? ($it mod 2) == 1
|
||||
```
|
@ -1,32 +0,0 @@
|
||||
---
|
||||
title: append
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Append a row to the table.
|
||||
|
||||
## Signature
|
||||
|
||||
```> append (row)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `row`: the row to append
|
||||
|
||||
## Examples
|
||||
|
||||
Append one Int item
|
||||
```shell
|
||||
> [0,1,2,3] | append 4
|
||||
```
|
||||
|
||||
Append three Int items
|
||||
```shell
|
||||
> [0,1] | append [2,3,4]
|
||||
```
|
||||
|
||||
Append Ints and Strings
|
||||
```shell
|
||||
> [0,1] | append [2,nu,4,shell]
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: benchmark
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Time the running time of a block
|
||||
|
||||
## Signature
|
||||
|
||||
```> benchmark (block)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `block`: the block to run
|
||||
|
||||
## Examples
|
||||
|
||||
Benchmarks a command within a block
|
||||
```shell
|
||||
> benchmark { sleep 500ms }
|
||||
```
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: build-string
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Create a string from the arguments.
|
||||
|
||||
## Signature
|
||||
|
||||
```> build-string ...rest```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `...rest`: list of string
|
||||
|
||||
## Examples
|
||||
|
||||
Builds a string from letters a b c
|
||||
```shell
|
||||
> build-string a b c
|
||||
```
|
||||
|
||||
Builds a string from letters a b c
|
||||
```shell
|
||||
> build-string (1 + 2) = one ' ' plus ' ' two
|
||||
```
|
@ -1,37 +0,0 @@
|
||||
---
|
||||
title: cal
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Display a calendar.
|
||||
|
||||
## Signature
|
||||
|
||||
```> cal --year --quarter --month --full-year --week-start --month-names```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--year`: Display the year column
|
||||
- `--quarter`: Display the quarter column
|
||||
- `--month`: Display the month column
|
||||
- `--full-year {int}`: Display a year-long calendar for the specified year
|
||||
- `--week-start {string}`: Display the calendar with the specified day as the first day of the week
|
||||
- `--month-names`: Display the month names instead of integers
|
||||
|
||||
## Examples
|
||||
|
||||
This month's calendar
|
||||
```shell
|
||||
> cal
|
||||
```
|
||||
|
||||
The calendar for all of 2012
|
||||
```shell
|
||||
> cal --full-year 2012
|
||||
```
|
||||
|
||||
This month's calendar with the week starting on monday
|
||||
```shell
|
||||
> cal --week-start monday
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: cd
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Change directory.
|
||||
|
||||
## Signature
|
||||
|
||||
```> cd (path)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `path`: the path to change to
|
||||
|
||||
## Examples
|
||||
|
||||
Change to your home directory
|
||||
```shell
|
||||
> cd ~
|
||||
```
|
@ -1,40 +0,0 @@
|
||||
---
|
||||
title: char
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Output special characters (e.g., 'newline').
|
||||
|
||||
## Signature
|
||||
|
||||
```> char (character) ...rest --list --unicode```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `character`: the name of the character to output
|
||||
- `...rest`: multiple Unicode bytes
|
||||
- `--list`: List all supported character names
|
||||
- `--unicode`: Unicode string i.e. 1f378
|
||||
|
||||
## Examples
|
||||
|
||||
Output newline
|
||||
```shell
|
||||
> char newline
|
||||
```
|
||||
|
||||
Output prompt character, newline and a hamburger character
|
||||
```shell
|
||||
> echo [(char prompt) (char newline) (char hamburger)] | str collect
|
||||
```
|
||||
|
||||
Output Unicode character
|
||||
```shell
|
||||
> char -u 1f378
|
||||
```
|
||||
|
||||
Output multi-byte Unicode character
|
||||
```shell
|
||||
> char -u 1F468 200D 1F466 200D 1F466
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: clear
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Clear the terminal.
|
||||
|
||||
## Signature
|
||||
|
||||
```> clear ```
|
||||
|
||||
## Examples
|
||||
|
||||
Clear the terminal
|
||||
```shell
|
||||
> clear
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: collect
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Collect the stream and pass it to a block.
|
||||
|
||||
## Signature
|
||||
|
||||
```> collect (block)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `block`: the block to run once the stream is collected
|
||||
|
||||
## Examples
|
||||
|
||||
Use the second value in the stream
|
||||
```shell
|
||||
> echo 1 2 3 | collect { |x| echo $x.1 }
|
||||
```
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
title: columns
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Show the columns in the input.
|
||||
|
||||
## Signature
|
||||
|
||||
```> columns ```
|
||||
|
||||
## Examples
|
||||
|
||||
Get the columns from the table
|
||||
```shell
|
||||
> [[name,age,grade]; [bill,20,a]] | columns
|
||||
```
|
||||
|
||||
Get the first column from the table
|
||||
```shell
|
||||
> [[name,age,grade]; [bill,20,a]] | columns | first
|
||||
```
|
||||
|
||||
Get the second column from the table
|
||||
```shell
|
||||
> [[name,age,grade]; [bill,20,a]] | columns | select 1
|
||||
```
|
@ -1,32 +0,0 @@
|
||||
---
|
||||
title: compact
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates a table with non-empty rows.
|
||||
|
||||
## Signature
|
||||
|
||||
```> compact ...columns```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `...columns`: the columns to compact from the table
|
||||
|
||||
## Examples
|
||||
|
||||
Filter out all records where 'Hello' is null (returns nothing)
|
||||
```shell
|
||||
> echo [["Hello" "World"]; [$nothing 3]]| compact Hello
|
||||
```
|
||||
|
||||
Filter out all records where 'World' is null (Returns the table)
|
||||
```shell
|
||||
> echo [["Hello" "World"]; [$nothing 3]]| compact World
|
||||
```
|
||||
|
||||
Filter out all instances of nothing from a list (Returns [1,2])
|
||||
```shell
|
||||
> echo [1, $nothing, 2] | compact
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: complete
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Complete the external piped in, collecting outputs and exit code
|
||||
|
||||
## Signature
|
||||
|
||||
```> complete ```
|
||||
|
||||
## Examples
|
||||
|
||||
Run the external completion
|
||||
```shell
|
||||
> ^external arg1 | complete
|
||||
```
|
@ -1,29 +0,0 @@
|
||||
---
|
||||
title: cp
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Copy files.
|
||||
|
||||
## Signature
|
||||
|
||||
```> cp (source) (destination) --recursive```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `source`: the place to copy from
|
||||
- `destination`: the place to copy to
|
||||
- `--recursive`: copy recursively through subdirectories
|
||||
|
||||
## Examples
|
||||
|
||||
Copy myfile to dir_b
|
||||
```shell
|
||||
> cp myfile dir_b
|
||||
```
|
||||
|
||||
Recursively copy dir_a to dir_b
|
||||
```shell
|
||||
> cp -r dir_a dir_b
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
title: dataframe
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Deprecated command
|
||||
|
||||
## Signature
|
||||
|
||||
```> dataframe ```
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
title: date
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
date
|
||||
|
||||
## Signature
|
||||
|
||||
```> date ```
|
@ -1,38 +0,0 @@
|
||||
---
|
||||
title: date format
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Format a given date using a format string.
|
||||
|
||||
## Signature
|
||||
|
||||
```> date format (format string) --list```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `format string`: the desired date format
|
||||
- `--list`: lists strftime cheatsheet
|
||||
|
||||
## Examples
|
||||
|
||||
Format a given date using the default format (RFC 2822).
|
||||
```shell
|
||||
> "2021-10-22 20:00:12 +01:00" | date format
|
||||
```
|
||||
|
||||
Format a given date using a given format string.
|
||||
```shell
|
||||
> date format '%Y-%m-%d'
|
||||
```
|
||||
|
||||
Format a given date using a given format string.
|
||||
```shell
|
||||
> date format "%Y-%m-%d %H:%M:%S"
|
||||
```
|
||||
|
||||
Format a given date using a given format string.
|
||||
```shell
|
||||
> "2021-10-22 20:00:12 +01:00" | date format "%Y-%m-%d"
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: date humanize
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Print a 'humanized' format for the date, relative to now.
|
||||
|
||||
## Signature
|
||||
|
||||
```> date humanize ```
|
||||
|
||||
## Examples
|
||||
|
||||
Print a 'humanized' format for the date, relative to now.
|
||||
```shell
|
||||
> date humanize
|
||||
```
|
||||
|
||||
Print a 'humanized' format for the date, relative to now.
|
||||
```shell
|
||||
> "2021-10-22 20:00:12 +01:00" | date humanize
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: date list-timezone
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
List supported time zones.
|
||||
|
||||
## Signature
|
||||
|
||||
```> date list-timezone ```
|
||||
|
||||
## Examples
|
||||
|
||||
Show timezone(s) that contains 'Shanghai'
|
||||
```shell
|
||||
> date list-timezone | where timezone =~ Shanghai
|
||||
```
|
@ -1,33 +0,0 @@
|
||||
---
|
||||
title: date now
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Get the current date.
|
||||
|
||||
## Signature
|
||||
|
||||
```> date now ```
|
||||
|
||||
## Examples
|
||||
|
||||
Get the current date and display it in a given format string.
|
||||
```shell
|
||||
> date now | date format "%Y-%m-%d %H:%M:%S"
|
||||
```
|
||||
|
||||
Get the time duration from 2019-04-30 to now
|
||||
```shell
|
||||
> (date now) - 2019-05-01
|
||||
```
|
||||
|
||||
Get the time duration since a more accurate time
|
||||
```shell
|
||||
> (date now) - 2019-05-01T04:12:05.20+08:00
|
||||
```
|
||||
|
||||
Get current time in full RFC3339 format with timezone
|
||||
```shell
|
||||
> date now | debug
|
||||
```
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
title: date to-table
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Print the date in a structured table.
|
||||
|
||||
## Signature
|
||||
|
||||
```> date to-table ```
|
||||
|
||||
## Examples
|
||||
|
||||
Print the date in a structured table.
|
||||
```shell
|
||||
> date to-table
|
||||
```
|
||||
|
||||
Print the date in a structured table.
|
||||
```shell
|
||||
> date now | date to-table
|
||||
```
|
||||
|
||||
Print the date in a structured table.
|
||||
```shell
|
||||
> '2020-04-12 22:10:57 +0200' | date to-table
|
||||
```
|
@ -1,37 +0,0 @@
|
||||
---
|
||||
title: date to-timezone
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Convert a date to a given time zone.
|
||||
|
||||
## Signature
|
||||
|
||||
```> date to-timezone (time zone)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `time zone`: time zone description
|
||||
|
||||
## Examples
|
||||
|
||||
Get the current date in UTC+05:00
|
||||
```shell
|
||||
> date now | date to-timezone +0500
|
||||
```
|
||||
|
||||
Get the current local date
|
||||
```shell
|
||||
> date now | date to-timezone local
|
||||
```
|
||||
|
||||
Get the current date in Hawaii
|
||||
```shell
|
||||
> date now | date to-timezone US/Hawaii
|
||||
```
|
||||
|
||||
Get the current date in Hawaii
|
||||
```shell
|
||||
> "2020-10-10 10:00:00 +02:00" | date to-timezone "+0500"
|
||||
```
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: debug
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Debug print the value(s) piped in.
|
||||
|
||||
## Signature
|
||||
|
||||
```> debug --raw```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--raw`: Prints the raw value representation
|
||||
|
||||
## Examples
|
||||
|
||||
Print the value of a string
|
||||
```shell
|
||||
> 'hello' | debug
|
||||
```
|
||||
|
||||
Print the value of a table
|
||||
```shell
|
||||
> echo [[version patch]; [0.1.0 false] [0.1.1 true] [0.2.0 false]] | debug
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: decode
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Decode bytes as a string.
|
||||
|
||||
## Signature
|
||||
|
||||
```> decode (encoding)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `encoding`: the text encoding to use
|
||||
|
||||
## Examples
|
||||
|
||||
Decode the output of an external command
|
||||
```shell
|
||||
> cat myfile.q | decode utf-8
|
||||
```
|
@ -1,24 +0,0 @@
|
||||
---
|
||||
title: def-env
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Define a custom command, which participates in the caller environment
|
||||
|
||||
## Signature
|
||||
|
||||
```> def-env (def_name) (params) (block)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `def_name`: definition name
|
||||
- `params`: parameters
|
||||
- `block`: body of the definition
|
||||
|
||||
## Examples
|
||||
|
||||
Set environment variable by call a custom command
|
||||
```shell
|
||||
> def-env foo [] { let-env BAR = "BAZ" }; foo; $env.BAR
|
||||
```
|
@ -1,29 +0,0 @@
|
||||
---
|
||||
title: def
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Define a custom command
|
||||
|
||||
## Signature
|
||||
|
||||
```> def (def_name) (params) (block)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `def_name`: definition name
|
||||
- `params`: parameters
|
||||
- `block`: body of the definition
|
||||
|
||||
## Examples
|
||||
|
||||
Define a command and run it
|
||||
```shell
|
||||
> def say-hi [] { echo 'hi' }; say-hi
|
||||
```
|
||||
|
||||
Define a command and run it with parameter(s)
|
||||
```shell
|
||||
> def say-sth [sth: string] { echo $sth }; say-sth hi
|
||||
```
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
title: default
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Sets a default row's column if missing.
|
||||
|
||||
## Signature
|
||||
|
||||
```> default (default value) (column name)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `default value`: the value to use as a default
|
||||
- `column name`: the name of the column
|
||||
|
||||
## Examples
|
||||
|
||||
Give a default 'target' column to all file entries
|
||||
```shell
|
||||
> ls -la | default 'nothing' target
|
||||
```
|
||||
|
||||
Default the `$nothing` value in a list
|
||||
```shell
|
||||
> [1, 2, $nothing, 4] | default 3
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: describe
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Describe the value(s) piped in.
|
||||
|
||||
## Signature
|
||||
|
||||
```> describe ```
|
||||
|
||||
## Examples
|
||||
|
||||
Describe the type of a string
|
||||
```shell
|
||||
> 'hello' | describe
|
||||
```
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
title: detect columns
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
splits contents across multiple columns via the separator.
|
||||
|
||||
## Signature
|
||||
|
||||
```> detect columns --skip --no-headers```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--skip {int}`: number of rows to skip before detecting
|
||||
- `--no-headers`: don't detect headers
|
||||
|
||||
## Examples
|
||||
|
||||
Splits string across multiple columns
|
||||
```shell
|
||||
> echo 'a b c' | detect columns -n
|
||||
```
|
||||
|
||||
Splits a multi-line string into columns with headers detected
|
||||
```shell
|
||||
> echo $'c1 c2 c3(char nl)a b c' | detect columns
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
title: dfr
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Dataframe commands
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr ```
|
@ -1,36 +0,0 @@
|
||||
---
|
||||
title: dfr aggregate
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Performs an aggregation operation on a dataframe and groupby object
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr aggregate (operation_name) --quantile --explicit```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `operation_name`:
|
||||
Dataframes: mean, sum, min, max, quantile, median, var, std
|
||||
GroupBy: mean, sum, min, max, first, last, nunique, quantile, median, var, std, count
|
||||
- `--quantile {number}`: quantile value for quantile operation
|
||||
- `--explicit`: returns explicit names for groupby aggregations
|
||||
|
||||
## Examples
|
||||
|
||||
Aggregate sum by grouping by column a and summing on col b
|
||||
```shell
|
||||
> [[a b]; [one 1] [one 2]] | dfr to-df | dfr group-by a | dfr aggregate sum
|
||||
```
|
||||
|
||||
Aggregate sum in dataframe columns
|
||||
```shell
|
||||
> [[a b]; [4 1] [5 2]] | dfr to-df | dfr aggregate sum
|
||||
```
|
||||
|
||||
Aggregate sum in series
|
||||
```shell
|
||||
> [4 1 5 6] | dfr to-df | dfr aggregate sum
|
||||
```
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
title: dfr all-false
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Returns true if all values are false
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr all-false ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns true if all values are false
|
||||
```shell
|
||||
> [false false false] | dfr to-df | dfr all-false
|
||||
```
|
||||
|
||||
Checks the result from a comparison
|
||||
```shell
|
||||
> let s = ([5 6 2 10] | dfr to-df);
|
||||
let res = ($s > 9);
|
||||
$res | dfr all-false
|
||||
```
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
title: dfr all-true
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Returns true if all values are true
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr all-true ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns true if all values are true
|
||||
```shell
|
||||
> [true true true] | dfr to-df | dfr all-true
|
||||
```
|
||||
|
||||
Checks the result from a comparison
|
||||
```shell
|
||||
> let s = ([5 6 2 8] | dfr to-df);
|
||||
let res = ($s > 9);
|
||||
$res | dfr all-true
|
||||
```
|
@ -1,30 +0,0 @@
|
||||
---
|
||||
title: dfr append
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Appends a new dataframe
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr append (other) --col```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `other`: dataframe to be appended
|
||||
- `--col`: appends in col orientation
|
||||
|
||||
## Examples
|
||||
|
||||
Appends a dataframe as new columns
|
||||
```shell
|
||||
> let a = ([[a b]; [1 2] [3 4]] | dfr to-df);
|
||||
$a | dfr append $a
|
||||
```
|
||||
|
||||
Appends a dataframe merging at the end of columns
|
||||
```shell
|
||||
> let a = ([[a b]; [1 2] [3 4]] | dfr to-df);
|
||||
$a | dfr append $a --col
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr arg-max
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Return index for max value in series
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr arg-max ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns index for max value
|
||||
```shell
|
||||
> [1 3 2] | dfr to-df | dfr arg-max
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr arg-min
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Return index for min value in series
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr arg-min ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns index for min value
|
||||
```shell
|
||||
> [1 3 2] | dfr to-df | dfr arg-min
|
||||
```
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: dfr arg-sort
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Returns indexes for a sorted series
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr arg-sort --reverse```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--reverse`: reverse order
|
||||
|
||||
## Examples
|
||||
|
||||
Returns indexes for a sorted series
|
||||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr arg-sort
|
||||
```
|
||||
|
||||
Returns indexes for a sorted series
|
||||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr arg-sort -r
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr arg-true
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Returns indexes where values are true
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr arg-true ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns indexes where values are true
|
||||
```shell
|
||||
> [false true false] | dfr to-df | dfr arg-true
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr arg-unique
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Returns indexes for unique values
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr arg-unique ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns indexes for unique values
|
||||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr arg-unique
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr column
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Returns the selected column
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr column (column)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `column`: column name
|
||||
|
||||
## Examples
|
||||
|
||||
Returns the selected column as series
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr column a
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr concatenate
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Concatenates strings with other array
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr concatenate (other)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `other`: Other array with string to be concatenated
|
||||
|
||||
## Examples
|
||||
|
||||
Concatenate string
|
||||
```shell
|
||||
> let other = ([za xs cd] | dfr to-df);
|
||||
[abc abc abc] | dfr to-df | dfr concatenate $other
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr contains
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Checks if a pattern is contained in a string
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr contains (pattern)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `pattern`: Regex pattern to be searched
|
||||
|
||||
## Examples
|
||||
|
||||
Returns boolean indicating if pattern was found
|
||||
```shell
|
||||
> [abc acb acb] | dfr to-df | dfr contains ab
|
||||
```
|
@ -1,19 +0,0 @@
|
||||
---
|
||||
title: dfr count-null
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Counts null values
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr count-null ```
|
||||
|
||||
## Examples
|
||||
|
||||
Counts null values
|
||||
```shell
|
||||
> let s = ([1 1 0 0 3 3 4] | dfr to-df);
|
||||
($s / $s) | dfr count-null
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr count-unique
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Counts unique values
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr count-unique ```
|
||||
|
||||
## Examples
|
||||
|
||||
Counts unique values
|
||||
```shell
|
||||
> [1 1 2 2 3 3 4] | dfr to-df | dfr count-unique
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr cumulative
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Cumulative calculation for a series
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr cumulative (type) --reverse```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `type`: rolling operation
|
||||
- `--reverse`: Reverse cumulative calculation
|
||||
|
||||
## Examples
|
||||
|
||||
Cumulative sum for a series
|
||||
```shell
|
||||
> [1 2 3 4 5] | dfr to-df | dfr cumulative sum
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr describe
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Describes dataframes numeric columns
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr describe --quantiles```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--quantiles {table}`: optional quantiles for describe
|
||||
|
||||
## Examples
|
||||
|
||||
dataframe description
|
||||
```shell
|
||||
> [[a b]; [1 1] [1 1]] | dfr to-df | dfr describe
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr drop-duplicates
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Drops duplicate values in dataframe
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr drop-duplicates (subset) --maintain```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `subset`: subset of columns to drop duplicates
|
||||
- `--maintain`: maintain order
|
||||
|
||||
## Examples
|
||||
|
||||
drop duplicates
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4] [1 2]] | dfr to-df | dfr drop-duplicates
|
||||
```
|
@ -1,31 +0,0 @@
|
||||
---
|
||||
title: dfr drop-nulls
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Drops null values in dataframe
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr drop-nulls (subset)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `subset`: subset of columns to drop nulls
|
||||
|
||||
## Examples
|
||||
|
||||
drop null values in dataframe
|
||||
```shell
|
||||
> let df = ([[a b]; [1 2] [3 0] [1 2]] | dfr to-df);
|
||||
let res = ($df.b / $df.b);
|
||||
let a = ($df | dfr with-column $res --name res);
|
||||
$a | dfr drop-nulls
|
||||
```
|
||||
|
||||
drop null values in dataframe
|
||||
```shell
|
||||
> let s = ([1 2 0 0 3 4] | dfr to-df);
|
||||
($s / $s) | dfr drop-nulls
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr drop
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates a new dataframe by dropping the selected columns
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr drop ...rest```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `...rest`: column names to be dropped
|
||||
|
||||
## Examples
|
||||
|
||||
drop column a
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr drop a
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr dtypes
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Show dataframe data types
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr dtypes ```
|
||||
|
||||
## Examples
|
||||
|
||||
Dataframe dtypes
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr dtypes
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr filter-with
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Filters dataframe using a mask as reference
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr filter-with (mask)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `mask`: boolean mask used to filter data
|
||||
|
||||
## Examples
|
||||
|
||||
Filter dataframe using a bool mask
|
||||
```shell
|
||||
> let mask = ([true false] | dfr to-df);
|
||||
[[a b]; [1 2] [3 4]] | dfr to-df | dfr filter-with $mask
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr first
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates new dataframe with first rows
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr first (rows)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `rows`: Number of rows for head
|
||||
|
||||
## Examples
|
||||
|
||||
Create new dataframe with head rows
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr first 1
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-day
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets day from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-day ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns day from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-day
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-hour
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets hour from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-hour ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns hour from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-hour
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-minute
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets minute from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-minute ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns minute from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-minute
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-month
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets month from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-month ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns month from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-month
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-nanosecond
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets nanosecond from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-nanosecond ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns nanosecond from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-nanosecond
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-ordinal
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets ordinal from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-ordinal ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns ordinal from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-ordinal
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-second
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets second from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-second ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns second from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-second
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-week
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets week from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-week ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns week from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-week
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-weekday
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets weekday from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-weekday ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns weekday from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-weekday
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr get-year
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Gets year from date
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get-year ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns year from a date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-year
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr get
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates dataframe with the selected columns
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr get ...rest```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `...rest`: column names to sort dataframe
|
||||
|
||||
## Examples
|
||||
|
||||
Creates dataframe with selected columns
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr get a
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr group-by
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates a groupby object that can be used for other aggregations
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr group-by ...rest```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `...rest`: groupby columns
|
||||
|
||||
## Examples
|
||||
|
||||
Grouping by column a
|
||||
```shell
|
||||
> [[a b]; [one 1] [one 2]] | dfr to-df | dfr group-by a
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr is-duplicated
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates mask indicating duplicated values
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr is-duplicated ```
|
||||
|
||||
## Examples
|
||||
|
||||
Create mask indicating duplicated values
|
||||
```shell
|
||||
> [5 6 6 6 8 8 8] | dfr to-df | dfr is-duplicated
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr is-in
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Checks if elements from a series are contained in right series
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr is-in (other)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `other`: right series
|
||||
|
||||
## Examples
|
||||
|
||||
Checks if elements from a series are contained in right series
|
||||
```shell
|
||||
> let other = ([1 3 6] | dfr to-df);
|
||||
[5 6 6 6 8 8 8] | dfr to-df | dfr is-in $other
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr is-not-null
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates mask where value is not null
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr is-not-null ```
|
||||
|
||||
## Examples
|
||||
|
||||
Create mask where values are not null
|
||||
```shell
|
||||
> let s = ([5 6 0 8] | dfr to-df);
|
||||
let res = ($s / $s);
|
||||
$res | dfr is-not-null
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: dfr is-null
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates mask where value is null
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr is-null ```
|
||||
|
||||
## Examples
|
||||
|
||||
Create mask where values are null
|
||||
```shell
|
||||
> let s = ([5 6 0 8] | dfr to-df);
|
||||
let res = ($s / $s);
|
||||
$res | dfr is-null
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr is-unique
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates mask indicating unique values
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr is-unique ```
|
||||
|
||||
## Examples
|
||||
|
||||
Create mask indicating unique values
|
||||
```shell
|
||||
> [5 6 6 6 8 8 8] | dfr to-df | dfr is-unique
|
||||
```
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: dfr join
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Joins a dataframe using columns as reference
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr join (dataframe) --left --right --type --suffix```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `dataframe`: right dataframe to join
|
||||
- `--left {table}`: left column names to perform join
|
||||
- `--right {table}`: right column names to perform join
|
||||
- `--type {string}`: type of join. Inner by default
|
||||
- `--suffix {string}`: suffix for the columns of the right dataframe
|
||||
|
||||
## Examples
|
||||
|
||||
inner join dataframe
|
||||
```shell
|
||||
> let right = ([[a b c]; [1 2 5] [3 4 5] [5 6 6]] | dfr to-df);
|
||||
$right | dfr join $right -l [a b] -r [a b]
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr last
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates new dataframe with tail rows
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr last (rows)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `rows`: Number of rows for tail
|
||||
|
||||
## Examples
|
||||
|
||||
Create new dataframe with last rows
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr last 1
|
||||
```
|
@ -1,19 +0,0 @@
|
||||
---
|
||||
title: dfr list
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Lists stored dataframes
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr list ```
|
||||
|
||||
## Examples
|
||||
|
||||
Creates a new dataframe and shows it in the dataframe list
|
||||
```shell
|
||||
> let test = ([[a b];[1 2] [3 4]] | dfr to-df);
|
||||
dfr list
|
||||
```
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
title: dfr melt
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Unpivot a DataFrame from wide to long format
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr melt --columns --values --variable-name --value-name```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--columns {table}`: column names for melting
|
||||
- `--values {table}`: column names used as value columns
|
||||
- `--variable-name {string}`: optional name for variable column
|
||||
- `--value-name {string}`: optional name for value column
|
||||
|
||||
## Examples
|
||||
|
||||
melt dataframe
|
||||
```shell
|
||||
> [[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | dfr to-df | dfr melt -c [b c] -v [a d]
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr not
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Inverts boolean mask
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr not ```
|
||||
|
||||
## Examples
|
||||
|
||||
Inverts boolean mask
|
||||
```shell
|
||||
> [true false true] | dfr to-df | dfr not
|
||||
```
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: dfr open
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Opens csv, json or parquet file to create dataframe
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr open (file) --delimiter --no-header --infer-schema --skip-rows --columns```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `file`: file path to load values from
|
||||
- `--delimiter {string}`: file delimiter character. CSV file
|
||||
- `--no-header`: Indicates if file doesn't have header. CSV file
|
||||
- `--infer-schema {number}`: Number of rows to infer the schema of the file. CSV file
|
||||
- `--skip-rows {number}`: Number of rows to skip from file. CSV file
|
||||
- `--columns {list<string>}`: Columns to be selected from csv file. CSV and Parquet file
|
||||
|
||||
## Examples
|
||||
|
||||
Takes a file name and creates a dataframe
|
||||
```shell
|
||||
> dfr open test.csv
|
||||
```
|
@ -1,24 +0,0 @@
|
||||
---
|
||||
title: dfr pivot
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Performs a pivot operation on a groupby object
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr pivot (pivot_column) (value_column) (operation)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `pivot_column`: pivot column to perform pivot
|
||||
- `value_column`: value column to perform pivot
|
||||
- `operation`: aggregate operation
|
||||
|
||||
## Examples
|
||||
|
||||
Pivot a dataframe on b and aggregation on col c
|
||||
```shell
|
||||
> [[a b c]; [one x 1] [two y 2]] | dfr to-df | dfr group-by a | dfr pivot b c sum
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr rename-col
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
rename a dataframe column
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr rename-col (from) (to)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `from`: column name to be renamed
|
||||
- `to`: new column name
|
||||
|
||||
## Examples
|
||||
|
||||
Renames a dataframe column
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr rename-col a a_new
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr rename
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Renames a series
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr rename (name)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `name`: new series name
|
||||
|
||||
## Examples
|
||||
|
||||
Renames a series
|
||||
```shell
|
||||
> [5 6 7 8] | dfr to-df | dfr rename new_name
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr replace-all
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Replace all (sub)strings by a regex pattern
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr replace-all --pattern --replace```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--pattern {string}`: Regex pattern to be matched
|
||||
- `--replace {string}`: replacing string
|
||||
|
||||
## Examples
|
||||
|
||||
Replaces string
|
||||
```shell
|
||||
> [abac abac abac] | dfr to-df | dfr replace-all -p a -r A
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr replace
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Replace the leftmost (sub)string by a regex pattern
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr replace --pattern --replace```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--pattern {string}`: Regex pattern to be matched
|
||||
- `--replace {string}`: replacing string
|
||||
|
||||
## Examples
|
||||
|
||||
Replaces string
|
||||
```shell
|
||||
> [abc abc abc] | dfr to-df | dfr replace -p ab -r AB
|
||||
```
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
title: dfr rolling
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Rolling calculation for a series
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr rolling (type) (window)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `type`: rolling operation
|
||||
- `window`: Window size for rolling
|
||||
|
||||
## Examples
|
||||
|
||||
Rolling sum for a series
|
||||
```shell
|
||||
> [1 2 3 4 5] | dfr to-df | dfr rolling sum 2 | dfr drop-nulls
|
||||
```
|
||||
|
||||
Rolling max for a series
|
||||
```shell
|
||||
> [1 2 3 4 5] | dfr to-df | dfr rolling max 2 | dfr drop-nulls
|
||||
```
|
@ -1,29 +0,0 @@
|
||||
---
|
||||
title: dfr sample
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Create sample dataframe
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr sample --n-rows --fraction --replace```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `--n-rows {int}`: number of rows to be taken from dataframe
|
||||
- `--fraction {number}`: fraction of dataframe to be taken
|
||||
- `--replace`: sample with replace
|
||||
|
||||
## Examples
|
||||
|
||||
Sample rows from dataframe
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr sample -n 1
|
||||
```
|
||||
|
||||
Shows sample row using fraction and replace
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4] [5 6]] | dfr to-df | dfr sample -f 0.5 -e
|
||||
```
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
title: dfr set-with-idx
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Sets value in the given index
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr set-with-idx (value) --indices```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `value`: value to be inserted in series
|
||||
- `--indices {any}`: list of indices indicating where to set the value
|
||||
|
||||
## Examples
|
||||
|
||||
Set value in selected rows from series
|
||||
```shell
|
||||
> let series = ([4 1 5 2 4 3] | dfr to-df);
|
||||
let indices = ([0 2] | dfr to-df);
|
||||
$series | dfr set-with-idx 6 -i $indices
|
||||
```
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
title: dfr set
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Sets value where given mask is true
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr set (value) --mask```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `value`: value to be inserted in series
|
||||
- `--mask {any}`: mask indicating insertions
|
||||
|
||||
## Examples
|
||||
|
||||
Shifts the values by a given period
|
||||
```shell
|
||||
> let s = ([1 2 2 3 3] | dfr to-df | dfr shift 2);
|
||||
let mask = ($s | dfr is-null);
|
||||
$s | dfr set 0 --mask $mask
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr shape
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Shows column and row size for a dataframe
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr shape ```
|
||||
|
||||
## Examples
|
||||
|
||||
Shows row and column shape
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr shape
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
---
|
||||
title: dfr shift
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Shifts the values by a given period
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr shift (period)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `period`: shift period
|
||||
|
||||
## Examples
|
||||
|
||||
Shifts the values by a given period
|
||||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr shift 2 | dfr drop-nulls
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr slice
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates new dataframe from a slice of rows
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr slice (offset) (size)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `offset`: start of slice
|
||||
- `size`: size of slice
|
||||
|
||||
## Examples
|
||||
|
||||
Create new dataframe from a slice of the rows
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr slice 0 1
|
||||
```
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
title: dfr sort
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates new sorted dataframe or series
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr sort ...rest --reverse```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `...rest`: column names to sort dataframe
|
||||
- `--reverse`: invert sort
|
||||
|
||||
## Examples
|
||||
|
||||
Create new sorted dataframe
|
||||
```shell
|
||||
> [[a b]; [3 4] [1 2]] | dfr to-df | dfr sort a
|
||||
```
|
||||
|
||||
Create new sorted series
|
||||
```shell
|
||||
> [3 4 1 2] | dfr to-df | dfr sort
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr str-lengths
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Get lengths of all strings
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr str-lengths ```
|
||||
|
||||
## Examples
|
||||
|
||||
Returns string lengths
|
||||
```shell
|
||||
> [a ab abc] | dfr to-df | dfr str-lengths
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr str-slice
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Slices the string from the start position until the selected length
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr str-slice (start) --length```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `start`: start of slice
|
||||
- `--length {int}`: optional length
|
||||
|
||||
## Examples
|
||||
|
||||
Creates slices from the strings
|
||||
```shell
|
||||
> [abcded abc321 abc123] | dfr to-df | dfr str-slice 1 -l 2
|
||||
```
|
@ -1,24 +0,0 @@
|
||||
---
|
||||
title: dfr strftime
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Formats date based on string rule
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr strftime (fmt)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `fmt`: Format rule
|
||||
|
||||
## Examples
|
||||
|
||||
Formats date
|
||||
```shell
|
||||
> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC');
|
||||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr strftime "%Y/%m/%d"
|
||||
```
|
@ -1,31 +0,0 @@
|
||||
---
|
||||
title: dfr take
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates new dataframe using the given indices
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr take (indices)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `indices`: list of indices used to take data
|
||||
|
||||
## Examples
|
||||
|
||||
Takes selected rows from dataframe
|
||||
```shell
|
||||
> let df = ([[a b]; [4 1] [5 2] [4 3]] | dfr to-df);
|
||||
let indices = ([0 2] | dfr to-df);
|
||||
$df | dfr take $indices
|
||||
```
|
||||
|
||||
Takes selected rows from series
|
||||
```shell
|
||||
> let series = ([4 1 5 2 4 3] | dfr to-df);
|
||||
let indices = ([0 2] | dfr to-df);
|
||||
$series | dfr take $indices
|
||||
```
|
@ -1,29 +0,0 @@
|
||||
---
|
||||
title: dfr to-csv
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Saves dataframe to csv file
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr to-csv (file) --delimiter --no-header```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `file`: file path to save dataframe
|
||||
- `--delimiter {string}`: file delimiter character
|
||||
- `--no-header`: Indicates if file doesn't have header
|
||||
|
||||
## Examples
|
||||
|
||||
Saves dataframe to csv file
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-csv test.csv
|
||||
```
|
||||
|
||||
Saves dataframe to csv file using other delimiter
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-csv test.csv -d '|'
|
||||
```
|
@ -1,33 +0,0 @@
|
||||
---
|
||||
title: dfr to-df
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Converts a List, Table or Dictionary into a dataframe
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr to-df ```
|
||||
|
||||
## Examples
|
||||
|
||||
Takes a dictionary and creates a dataframe
|
||||
```shell
|
||||
> [[a b];[1 2] [3 4]] | dfr to-df
|
||||
```
|
||||
|
||||
Takes a list of tables and creates a dataframe
|
||||
```shell
|
||||
> [[1 2 a] [3 4 b] [5 6 c]] | dfr to-df
|
||||
```
|
||||
|
||||
Takes a list and creates a dataframe
|
||||
```shell
|
||||
> [a b c] | dfr to-df
|
||||
```
|
||||
|
||||
Takes a list of booleans and creates a dataframe
|
||||
```shell
|
||||
> [true true false] | dfr to-df
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
---
|
||||
title: dfr to-dummies
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Creates a new dataframe with dummy variables
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr to-dummies ```
|
||||
|
||||
## Examples
|
||||
|
||||
Create new dataframe with dummy variables from a dataframe
|
||||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-dummies
|
||||
```
|
||||
|
||||
Create new dataframe with dummy variables from a series
|
||||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr to-dummies
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
title: dfr to-lowercase
|
||||
layout: command
|
||||
version: 0.59.1
|
||||
---
|
||||
|
||||
Lowercase the strings in the column
|
||||
|
||||
## Signature
|
||||
|
||||
```> dfr to-lowercase ```
|
||||
|
||||
## Examples
|
||||
|
||||
Modifies strings to lowercase
|
||||
```shell
|
||||
> [Abc aBc abC] | dfr to-df | dfr to-lowercase
|
||||
```
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user