torcharrow.functional.firstx
- torcharrow.functional.firstx(col: ListColumn, num_to_copy: int)
Returns the first x values of the head of the input column
- Parameters:
col (Column that has a list of values) –
num_to_copy (Number of elements to return from the head of the list) –
Examples
>>> 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