Contents

column(type:)

Clones the column to a data column of the given type.

Declaration

func column<T>(type: T.Type) -> MLDataColumn<T>? where T : MLDataValueConvertible

Parameters

  • type:

    A metatype used to create a new data column of that type.

Return Value

A new data column if the underlying type of the column is the same as type; otherwise nil.

Discussion

Use this method to create a typed copy of the column. For example, to create a data column of integers from an untyped column of integers, use column(type:) with Int.self as the argument for the type parameter.

See Also

Exposing the underlying type to generate a data column