2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: dfr take
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
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
|
|
|
|
```
|