filter:
The DataListFilter node is designed to streamline the process of filtering data lists based on boolean criteria. Its primary function is to take two lists: a value list containing any type of data and a filter list composed solely of boolean values. The node then generates a new list that includes only those elements from the value list where the corresponding boolean in the filter list is False. This functionality is particularly useful for scenarios where you need to exclude certain items from a dataset based on specific conditions. The node automatically handles cases where the two lists are of different lengths by repeating the last element of the shorter list to match the length of the longer one, ensuring seamless operation without manual adjustments.
filter Input Parameters:
value
The value parameter is a list that can contain any type of data elements. This list represents the dataset from which you want to filter out certain elements. The elements in this list are evaluated against the corresponding boolean values in the filter list. There are no specific minimum or maximum values for this parameter, as it can include any data type and any number of elements. The effectiveness of the filtering process depends on the content of this list, as it determines which elements are subject to exclusion based on the filter list.
filter
The filter parameter is a list consisting exclusively of boolean values (True or False). This list acts as a criterion for filtering the value list. Each boolean value in the filter list corresponds to an element in the value list, determining whether that element should be included in the output list. If the boolean value is False, the corresponding element in the value list is included in the output; if True, it is excluded. The filter list must be provided with the same or fewer elements than the value list, as any discrepancy in length is automatically adjusted by repeating the last element of the shorter list.
filter Output Parameters:
filtered_list
The filtered_list is the output parameter that contains the resulting list after the filtering process. This list includes only those elements from the value list where the corresponding boolean in the filter list is False. The filtered_list provides a streamlined dataset that excludes unwanted elements, making it easier to work with and analyze. This output is crucial for tasks that require a refined dataset based on specific exclusion criteria.
filter Usage Tips:
- Ensure that the
filterlist is correctly aligned with thevaluelist to achieve the desired filtering effect. If the lists are of different lengths, remember that the node will automatically repeat the last element of the shorter list to match the longer one. - Use the
DataListFilternode when you need to exclude specific elements from a dataset based on boolean conditions, such as removing invalid or unwanted entries from a list.
filter Common Errors and Solutions:
Mismatched list lengths
- Explanation: The
valueandfilterlists have different lengths, which might lead to unexpected results if not handled properly. - Solution: The node automatically repeats the last element of the shorter list to match the length of the longer one. Ensure that this behavior aligns with your intended filtering logic.
Invalid filter values
- Explanation: The
filterlist contains non-boolean values, which can cause the node to malfunction. - Solution: Verify that the
filterlist contains only boolean values (TrueorFalse) to ensure proper operation of the node.
