tail() 函数
tail()
函数将每个输出表限制为最后 n
行。
tail()
为每个输入表生成一个输出表。每个输出表包含 offset
之前的最后 n
条记录。如果输入表包含少于 offset + n
条记录,则 tail()
输出 offset
之前的所有记录。
函数类型签名
(<-tables: stream[A], n: int, ?offset: int) => stream[A]
有关更多信息,请参阅 函数类型签名。
参数
n
(必需)要输出的最大行数。
offset
在限制为 n
之前,在表尾部要跳过的记录数。默认为 0。
tables
输入数据。默认为管道转发数据 (<-
)。
示例
输出每个输入表中最后三行
import "sampledata"
sampledata.int()
|> tail(n: 3)
输出每个输入表中倒数第二行之前的最后三行
import "sampledata"
sampledata.int()
|> tail(n: 3, offset: 1)
此页面是否对您有帮助?
感谢您的反馈!