Generic Instance Method

map(to:)

Creates a new column by converting this column to the given type.

Declaration

func map<T>(to type: T.Type) -> MLDataColumn<T> where T : MLDataValueConvertible

Parameters

type

A type of MLDataColumn to convert the contents of the column to, using MLDataValueConvertible.

Return Value

A new column.

Discussion

This method is functionally equivalent to the initializers of MLDataColumn that have one parameter column, such as init(column:).

See Also

Creating a Data Column by Converting Another Column

init<T>(column: MLDataColumn<T>)

Creates a new column of integers from a given column whose elements can be converted to integers.

init<T>(column: MLDataColumn<T>)

Creates a new column of arrays of integers from a given column whose elements can be converted to an array of integers.

init<T>(column: MLDataColumn<T>)

Creates a new column of doubles from a given column whose elements can be converted to doubles.

init<T>(column: MLDataColumn<T>)

Creates a new column of arrays of doubles from a given column whose elements can be converted to an array of doubles.

init<T>(column: MLDataColumn<T>)

Creates a new column of strings from a given column whose elements can be converted to strings.

init<T>(column: MLDataColumn<T>)

Creates a new column of arrays of strings from a given column whose elements can be converted to an array of strings.

init<T>(column: MLDataColumn<T>)

Creates a new column of machine learning sequences from a given column whose elements can be converted to sequences.

init<T>(column: MLDataColumn<T>)

Creates a new column of machine learning dictionaries from a given column whose elements can be converted to dictionaries.