torcharrow.functional.firstx¶
- torcharrow.functional.firstx(col: ListColumn, num_to_copy: int)¶
傳回輸入欄位開頭的前 x 個值
- 參數:
col (具有值列表的欄位) –
num_to_copy (要從列表開頭傳回的元素數量) –
範例
>>> import torcharrow as ta >>> from torcharrow import functional >>> a = ta.column([[1, 2, 3],[5,8],[13]]) >>> functional.firstx(a, 3) 0 [1, 2, 3] 1 [5, 8] 2 [13] dtype: List(Int64(nullable=True), nullable=True), length: 3, null_count: 0