Creates a subset of the table by masking the rows with the given untyped column.
- macOS 10.14+
- Xcode 10.0+
- Create ML
An untyped column indicating whether rows should be removed (a default value) or included (any nondefault value) in the derived table.
A new data table.
Use this untyped column–based subscript to create a new table by masking a subset of the table rows. The derived table will not include rows where
mask contains a default value for its underlying type, such as:
An empty string in untyped
The derived data table includes rows where the masking column has any other (nondefault) value.
For example, to filter the values in a data table as shown above, begin by creating a table with the original data.
After you create the table, use the
subscript(_:) to extract a column.
subscript(mask: MLUntyped with an untyped column–row mask to create a filtered table. The subscript uses the untyped values to determine whether to keep a row.
In this example, the untyped column
pages has an underlying type of
Int. The subscript removes any row with a value of
0 (the default value for
Int) and keeps all other rows.