pyarrow.compute.list_slice#
- pyarrow.compute.list_slice(lists, /, start, stop=None, step=1, return_fixed_size_list=None, *, options=None, memory_pool=None)#
Compute slice of list-like array.
lists must have a list-like type. For each list element, compute a slice, returning a new list array. A variable or fixed size list array is returned, depending on options.
- Parameters:
- listsArray-like or scalar-like
Argument to compute function.
- start
int
Index to start slicing inner list elements (inclusive).
- stop
Optional
[int
], defaultNone
If given, index to stop slicing at (exclusive). If not given, slicing will stop at the end. (NotImplemented)
- step
int
, default 1 Slice step.
- return_fixed_size_list
Optional
[bool], defaultNone
Whether to return a FixedSizeListArray. If true _and_ stop is after a list element’s length, nulls will be appended to create the requested slice size. The default of None will return the same type which was passed in.
- options
pyarrow.compute.ListSliceOptions
, optional Alternative way of passing options.
- memory_pool
pyarrow.MemoryPool
, optional If not passed, will allocate memory from the default memory pool.