2020-05-18 07:13:03 +00:00
|
|
|
# shuffle
|
|
|
|
|
|
|
|
Shuffles the rows in a random order.
|
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
## Examples
|
2020-05-18 07:13:03 +00:00
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
Passing the same input to shuffle multiple times gives different results -
|
2020-05-18 07:13:03 +00:00
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
```shell
|
|
|
|
> echo [ a b c d ] | shuffle
|
2020-05-18 07:13:03 +00:00
|
|
|
───┬───
|
2020-06-23 18:21:47 +00:00
|
|
|
0 │ a
|
|
|
|
1 │ c
|
|
|
|
2 │ d
|
|
|
|
3 │ b
|
2020-05-18 07:13:03 +00:00
|
|
|
───┴───
|
2020-06-23 18:21:47 +00:00
|
|
|
```
|
2020-05-18 07:13:03 +00:00
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
```shell
|
|
|
|
> echo [ a b c d ] | shuffle
|
2020-05-18 07:13:03 +00:00
|
|
|
───┬───
|
2020-06-23 18:21:47 +00:00
|
|
|
0 │ c
|
|
|
|
1 │ b
|
|
|
|
2 │ d
|
|
|
|
3 │ a
|
2020-05-18 07:13:03 +00:00
|
|
|
───┴───
|
2020-06-23 18:21:47 +00:00
|
|
|
```
|
2020-05-18 07:13:03 +00:00
|
|
|
|
2020-06-23 18:21:47 +00:00
|
|
|
```shell
|
|
|
|
> echo [ a b c d ] | shuffle
|
2020-05-18 07:13:03 +00:00
|
|
|
───┬───
|
2020-06-23 18:21:47 +00:00
|
|
|
0 │ c
|
|
|
|
1 │ b
|
|
|
|
2 │ a
|
|
|
|
3 │ d
|
2020-05-18 07:13:03 +00:00
|
|
|
───┴───
|
|
|
|
```
|