捷徑

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

文件

存取 PyTorch 的完整開發者文件

檢視文件

教學課程

取得適用於初學者和進階開發者的深入教學課程

檢視教學課程

資源

尋找開發資源並獲得問題解答

檢視資源