mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 17:03:45 +01:00
30 lines
554 B
Markdown
30 lines
554 B
Markdown
---
|
|
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
|
|
```
|