Generic Instance Method

map(_:)

Creates a new column of typed values, potentially with missing values, by applying the given thread-safe transform to every non-missing element of this untyped column.

Declaration

func map<T>(_ lazyTransform: @escaping (MLDataValue) -> T?) -> MLDataColumn<T> where T : MLDataValueConvertible

Parameters

lazyTransform

A thread-safe element transformation function. The implementation of the transform you provide should accept an Element of the column and return a transformed value of a type that conforms to MLDataValueConvertible. If the transform returns nil for a given element, the corresponding element in the new column will have a missing value.

Return Value

A new MLDataColumn typed to the return type of lazyTransform.

See Also

Transforming Elements to Generate a Data Column

func map<T>((MLDataValue) -> T) -> MLDataColumn<T>

Creates a new column of typed values by applying the given thread-safe transform to every non-missing element of this untyped column.

func mapMissing<T>((MLDataValue) -> T?) -> MLDataColumn<T>

Creates a new column of typed values by applying the given thread-safe transform to every element of this untyped column, including missing elements.