🟧 Generic List Extract

Function Description

This operator has powerful functionality and can extract one or more elements from the input list in various ways to form a new list output. Supports extraction by single index, index range, index list, and supports reverse extraction.

Usage Scenarios

  • Precise extraction: Can quickly obtain the 1st, 5th, 8th elements, etc. from a longer list based on specified indices.

  • Range extraction: Supports batch extraction of elements in a consecutive interval in the list, for example, get the first 5 elements (indices 0~4).

  • Delete specific elements: Allows removal of specific elements in the list by index or specified value, keeping other elements unchanged.

  • Disorder and reorganization: Can perform disorder processing or reordering on lists according to custom rules, achieving flexible data reorganization.

Input Output

Input

Input List: Any type of list.

Output

Extract Results: A new list containing all elements extracted according to rules.

Parameter Description

Extract Method

Parameter Description

Select the core logic for extracting elements.

Parameter Adjustment

  • Extract Single: Extract only one element.

  • Range Extract: Extract elements in a consecutive interval.

  • Specified Index List Extract: Extract multiple specified elements based on provided index list.

Parameter Range

  • Default value: Extract Single.

  • Optional values: Extract Single, Range Extract, Specified Index List Extract.

Index

Parameter Description

Used in "Extract Single" mode to specify the index of the element to extract.

Parameter Adjustment

Index starts from 0. Supports negative indices, for example, -1 means extract the first element from the end of the list, -2 means second from the end.

Parameter Range

Value range: [-10000, 10000], Default value: 0

Min/Max Index

Parameter Description

Used in "Index Range Extract" mode to define the start and end indices of the extraction range (including both endpoints).

Parameter Adjustment

For example, if min index is 2 and max index is 5, will extract four elements with indices "2, 3, 4, 5".

Parameter Range

Value range: [-10000, 10000], Default value: 0

Index List

Parameter Description

Used in "Specified Index List Extract" mode, provide a list containing indices of all elements to be extracted.

Parameter Adjustment

For example, input [0, 5, 2] will extract elements with indices 0, 5, and 2 from the original list in this order and form a new list.

Reverse Extract

Parameter Description

Invert extraction logic.

Parameter Adjustment

  • Off (Default): Keep specified indices, extract their corresponding elements.

  • On: Remove specified indices, keep all other elements in the list.