Creates a new column by applying a given thread-safe transform to every row in the data table.
- macOS 10.14+
- Xcode 10.0+
- Create ML
A thread-safe row transformation function.
The implementation of your transform must accept a row from the data table and return a type that conforms to
Use this method to create a new column derived from the existing data in the table. The closure you pass evaluates lazily only when the transformed values are needed for a subsequent operation. Your implementation should accept a data table row and must be thread-safe because the framework may invoke the closure concurrently on unspecified threads.
For example, to perform the column derivation operation shown above, begin by creating a table of data.
After creating the table, use
map(_:) to create a new column of data from the original data. The example closure implementation below is stateless and safe to invoke concurrently on any thread, so no synchronization is necessary.
add to add the derived column to a table.