Generic Instance Method

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

var type: MLDataValue.ValueType

The underlying type of the column.

var ints: MLDataColumn<Int>?

A cloned data column of integers.

var doubles: MLDataColumn<Double>?

A cloned data column of doubles.

var strings: MLDataColumn<String>?

A cloned data column of strings.

var sequences: MLDataColumn<MLDataValue.SequenceType>?

A cloned data column of machine learning sequences.

var dictionaries: MLDataColumn<MLDataValue.DictionaryType>?

A cloned data column of machine learning dictionaries.

var multiArrays: MLDataColumn<MLDataValue.MultiArrayType>?

A cloned data column of machine learning multi-arrays.