Array node
Array Unique
Remove duplicate values from an array, keeping first occurrences. Float comparison uses a configurable epsilon tolerance. Reports how many duplicates were removed.
Inputs
| Port | Type | Default |
|---|---|---|
| ArrayThe list to strip duplicates from. Order is preserved — the first appearance of each value is the one kept. | any | — |
| EpsilonHow close two numbers must be to count as the same value. Not clamped; 0 demands an exact match, tiny values like 0.0001 absorb rounding noise, and large values collapse the list toward a single entry. Text and switches always compare exactly. | float | 0.0001 |
Outputs
| Port | Type |
|---|---|
| Result | any |
| Count | int |
| Removed | int |
How It Works
Array Unique scans the array and removes duplicate values, keeping only the first occurrence of each. For float values, two numbers are considered equal if their difference is less than Epsilon. Strings are compared exactly.
Removed reports how many duplicate elements were discarded.
Use Cases
- Data deduplication: Remove repeated sensor readings that occur when sampling is faster than data changes.
- Category extraction: From an array of class labels, extract the unique set of categories present.
- Palette building: Extract unique color values from a dataset for creating a legend.
Tips
- Increase Epsilon for "fuzzy" deduplication where values within a tolerance should be treated as the same (e.g., 0.01 for values that differ by less than 1%).
- Set Epsilon to 0 for exact matching only.
- The output preserves the original order of first occurrences.
Open Array Unique in the interactive catalog →
Array Unique is one of 381 nodes in Grafit Pro.
Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.