dfr sample for dataframe

Create sample dataframe.

Signature

> dfr sample --n-rows --fraction --seed --replace --shuffle

Parameters

  • --n-rows {int}: number of rows to be taken from dataframe
  • --fraction {number}: fraction of dataframe to be taken
  • --seed {number}: seed for the selection
  • --replace (-e): sample with replace
  • --shuffle (-u): shuffle sample

Input/output types:

inputoutput
anyany

Examples

Sample rows from dataframe

> [[a b]; [1 2] [3 4]] | dfr into-df | dfr sample -n 1

Shows sample row using fraction and replace

> [[a b]; [1 2] [3 4] [5 6]] | dfr into-df | dfr sample -f 0.5 -e

Tips: Dataframe commands were not shipped in the official binaries by default, you have to build it with --features=dataframe flag