sample() 函数
sample()
从每个输入表中选择行的子集。
注意: sample()
会删除空表。
函数类型签名
(<-tables: stream[A], n: int, ?column: string, ?pos: int) => stream[A] where A: Record
有关更多信息,请参阅 函数类型签名。
参数
n
(必需) 每隔 N 个元素采样一次。
pos
从结果开始处的偏移位置,采样从此处开始。默认为 -1(随机偏移)。
pos
必须小于 n
。如果 pos 小于 0,则使用随机偏移。
column
要操作的列。
tables
输入数据。默认为管道转发数据 (<-
)。
示例
采样每隔一个结果
import "sampledata"
sampledata.int()
|> sample(n: 2, pos: 1)
此页内容是否有帮助?
感谢您的反馈!