List

This section describes operators belonging to the List category.

This page discusses:

Append Lists

Concatenates as many lists as you want thanks to its dynamic connectors.

Inputs

Name Type Description
List List The lists to concatenate

Outputs

Name Type Description
List List Resulting list

Build List

Creates lists containing items passed in inputs.

Inputs

Name Type Description
Item The item to include in the list

Outputs

Name Type Description
List List

Cluster by density

Clusters together vectors that are closely packed together (with minimum number of vectors and specified density).

Inputs

Name Type Description
Vectors Vector The list of vectors (supports all dimensions) or a list of points to cluster.
Minimum number of vectors Integer The minimum number of vectors to form a cluster.
Radius Real The maximum distance between two vectors to be in the same cluster.
List List Structure the list as clusters.

Outputs

Name Type Description
Vectors Vector Cluster of vectors

Cluster by number

Clusters vectors or points according in a given set of clusters according to their distance with each other.

Inputs

Name Type Description
Vector Vector You can pass a list of vectors (supports all dimensions) or a list of points
Number of Clusters Integer
Iterations Integer Higher this value, the better the clustering result. but it has an influence of computation performances
List List Structure the list as clusters

Outputs

Name Type Description
Points Vector List of clustered points

Combine

Creates structures with all possible combinations of the inputs.

Inputs

Name Type Description
A List
Modes Integer 0: all 1: half top 2: half bottom
Identity Boolean Remove identity

Count

Count the number of occurrences of a given value in a list.

Inputs

Name Type Description
List List Input list
Value Value to find
Mode Integer Compare objects or compare values

Outputs

Name Type Description
Count Integer Number of occurrences found

Deepen

Transforms any item in a list containing itself. increases the structure depth by the leaves.

Inputs

Name Type Description
Values List

Outputs

Name Type Description
List List

Fit Cyclic

Extends the shortest lists by repeating their content until they fit the longest one.

Inputs

Name Type Description
A List

Fit Longest

Extends the shortest lists by repeating their last item until they fit the longest one.

Inputs

Name Type Description
A List

Fit Shortest

Truncates the longuest lists to fit the shortest one.

Inputs

Name Type Description
A List

Flatten

Flattens any structure and return a simple list.

Inputs

Name Type Description
Struct List Input structure

Outputs

Name Type Description
List List Resulting list

Get Each Item

Returns each item of a list on a different output (formerly named get items).

Inputs

Name Type Description
List List Input list
Index Integer Index to start from
End Boolean True to start from the end of the list

Outputs

Name Type Description
Out Dynamic outputs with holding each item

Get Item

Returns the input list item at the given index.

Inputs

Name Type Description
List List Input list
Index Integer Index of the item to get
From end Boolean Get item starting from the end of the input list

Outputs

Name Type Description
O Item at the given index

Get Item Path

Returns the item at the path given by a list of integers.

Inputs

Name Type Description
List List Input structure
Index Integer List of indices representing the path

Outputs

Name Type Description
Obj Item at the given path

Get Items

Returns the input list items at the given indexes.

Inputs

Name Type Description
List List Input list
Indexes Integer List of indexes of the items to get
From end Boolean Get item starting from the end of the input list

Outputs

Name Type Description
O Items at the given indexes

Group

Given a list (vals) and an integer (nb) smaller than this list's size, this node creates groups of nb elements from vals. <br/><br/>for example : if vals.

Inputs

Name Type Description
Values List
Number Integer Size of the lists containing the subelements of vals
Adjacent Boolean Boolean to decide whether the last element of a sublist is the first element of the following sublist.
Loop Boolean Boolean to decide whether vals first element should be also considered as its last element

Outputs

Name Type Description
List List List of small groups from the list vals

Index Of

Finds the position of an element in the list. returns an empty value if element has not been found. to get the path of index of a given depth, adjust the dimension of input l.

Inputs

Name Type Description
List List List of values to search in. dimension can be 1 get a simple index, or superior to 1 to get a path of index.
All Boolean If true, returns all the indices where the given value is found. else returns only the first one.
Value Unknown type Value to search
Mode Compare objects or compare values

Outputs

Name Type Description
Indices List Found indices.

Insert

Inserts items from a list in another one at a given index. you can specify period > 0 to have a periodic insertion.

Inputs

Name Type Description
List 1 List Original list
List 2 List List to insert in the original
Index Integer Index to start the insertion at
Position Boolean Boolean to specify if the insertion is to be carried out at the original index list (true) or if the insertion should take into account the latest appended elements and use the index of the output list (false).
Period Integer Number of original items to leave between two insertions

Outputs

Name Type Description
List 3 List Result list

Intersect Lists

Returns the intersection of two lists (the list of common elements).

Inputs

Name Type Description
List List
List 2 List
Mode Integer Compare objects or compare values

Outputs

Name Type Description
List List

Invert Order

Inverts the order of a list.

Inputs

Name Type Description
List 1 List

Outputs

Name Type Description
List 2 List

Mix

Builds a list taking alternatively one item of each input list.

Inputs

Name Type Description
List List Lists to mix
Complete with Last Boolean If a list is shorten than the others, complete with its last item

Outputs

Name Type Description
List List Result list

Odd Even

Splits the input list in two lists conainting the odd and the even items of the list.

Inputs

Name Type Description
List List

Outputs

Name Type Description
Odd List
Even List

Polar Sort

Sorts a list of points by angle.

Inputs

Name Type Description
Points Point
Polar Origin Point
Direction Vector
Order Boolean

Outputs

Name Type Description
Sorted Points Point

Remove Duplicates

Keeps only the first value of each.

Inputs

Name Type Description
List List Original list
Mode Integer Compare objects or compare values

Outputs

Name Type Description
List List Treated list

Remove Empty

Removes empty values from a list.

Inputs

Name Type Description
List List

Outputs

Name Type Description
List List

Remove Error

Removes error values from a list.

Inputs

Name Type Description
List List

Outputs

Name Type Description
List List

Remove First

Shortens a list by removing the first value.

Inputs

Name Type Description
List List Original list

Outputs

Name Type Description
List List Modified list

Remove Index

Removes an element given by an index from a list. to remove several items set index input dimension to 1.

Inputs

Name Type Description
List List Original list.
Index Integer Index of the element(s) you want to remove. dimension can be 0 to remove one item or 1 to remove a list of items.

Outputs

Name Type Description
List List Modified list.

Remove Item

Remove a given object from a list. to remove several objects set obj input dimension to 1.

Inputs

Name Type Description
List List Original list
Obj Object(s) to find and remove. dimension can be 0 to remove one item or 1 to remove a list of items.
All Boolean False to remove only the first occurrence, true to remove all
From end Boolean Remove item starting from the end of the original list
Mode Integer Compare objects or compare values

Outputs

Name Type Description
List List Modified list

Remove Last

Shortens a list by removing the last value.

Inputs

Name Type Description
List List Original list

Outputs

Name Type Description
List List Modified list

Remove List from List

Removes the common elements in two lists from the first list.

Inputs

Name Type Description
List 1 List
List 2 List
Mode Integer Compare objects or compare values

Outputs

Name Type Description
List List

Repeat

Repeats elements in a list several times or repeats the whole list several times.

Inputs

Name Type Description
List List
Elements Integer Number of elements to repeat
Series Integer Number of series to repeat

Outputs

Name Type Description
List 2 List

Replace Item

Replaces a given value by another in a list. to replace several values set obj and rpl input dimension to 1.

Inputs

Name Type Description
List List Original list.
Obj Value to find and replace. dimension can be 0 to replace one item or 1 to replace a list of items with a list of values. dimension of obj and rpl must be equal.
Rpl Replacing value. dimension can be 0 to replace one item or 1 to replace a list of items with a list of values. dimension of obj and rpl must be equal.
All Boolean False to replace only the first occurrence, true to replace all.
Mode Compare objects or compare values

Outputs

Name Type Description
List List Modified list.

Restructure

Populates a given structure with values from a flat list. the given structure and the list must have the same number of items.

Inputs

Name Type Description
Reference List Reference structure to populate
List List Flat list providing values

Outputs

Name Type Description
Resulting structure List

Sample

Distributes alternatively the items of a list to a given number of lists.

Inputs

Name Type Description
List List Input list
Number Integer Number of list to distribute to

Outputs

Name Type Description
List List Resulting list of lists

Set Items

Set a value at a given index.

Inputs

Name Type Description
List List Original list
Object Object to set in the original list. dimension can be 0 to set one item or 1 to set a list of items with a list of values. dimension of obj and idx must be equal.
Index Integer Set object at a given index. dimension can be 0 to set one item or 1 to set a list of items with a list of values. dimension of obj and idx must be equal.

Outputs

Name Type Description
Output list List Modified list.

Shift

Shifts any value in a list by a given integer value. can move the elements up (negative values) or down (positive values).

Inputs

Name Type Description
List 1 List
Shift Integer

Outputs

Name Type Description
List 2 List

Shorten

Shortens a list by removing a given number of values at the start and at the end.

Inputs

Name Type Description
List List Original list
Start Number Integer Number of items to remove at the start of the list
End Number Integer Number of items to remove at the end of the list

Outputs

Name Type Description
List List Modified list

Shuffle List

Moves randomly the items of a list.

Inputs

Name Type Description
List List List to randomize
Ratio Real Proportion of moving items. example : 0.1 means 10% of moving items.
Distance Real Maximum moving distance for moving items. 0.1 and a list of 100 items means each moving items will move between 1 and 10 (100*0.1) items. negative values mean the ratio input is used to control the distance.
Use Seed Boolean Use the seed input to keep stability of the randomization.
Seed Integer Seed used to keep stability when use seed is true.

Outputs

Name Type Description
Randomized List List

Size

Returns the number of items of the input list.

Inputs

Name Type Description
List List Input list

Outputs

Name Type Description
Size Integer Number of items in the input list

Sort

Enables to sort one or more list considering a reference list and an expression. by default, it waits for a list of real values and sorts in an ascendant way. but you can sort any kind of list depending on the input expression and your sort criteria. you can add as many secondary lists as you want: their order will be modified the same way as the main sorted one.

Inputs

Name Type Description
List List

Outputs

Name Type Description
Out Result of the sort

Split List

Splits a list in two at a given position.

Inputs

Name Type Description
List List List to split.
Index Integer Index of the last item to put in the first list. following items are in the second list.

Outputs

Name Type Description
List 1 List
List 2 List

Sublist

Extracts a sublist from a bigger list.

Inputs

Name Type Description
List List The list to extract the sublist from.
Start Index Integer Index to start from.
End Index Integer Index to end extraction.

Outputs

Name Type Description
Sublist List The resulting list.

Swap

Swaps the position of two values in a list. ( reorder ).

Inputs

Name Type Description
List List Original list
Index 1 Integer First item to swap
Index 2 Integer Second item to swap

Outputs

Name Type Description
List List Modified list

Transpose

Transposes the last two levels of the structure. for example, if you have [[1 2][3 4][5 6]], it gives you [[1 3 5][2 4 6]].

Inputs

Name Type Description
List List

Outputs

Name Type Description
Transposed List List