---
title: "init(ints:)"
framework: createml
role: symbol
role_heading: Initializer
path: "createml/mluntypedcolumn/init(ints:)"
---

# init(ints:)

Creates a new column of integers by converting the elements of another column.

## Declaration

```swift
init(ints: MLUntypedColumn)
```

## Parameters

- `ints`: A column with elements that are convertible to integers.

## Return Value

Return Value A new untyped column of integers; otherwise an invalid column if any element of the given column cannot be converted to Int.

## Discussion

Discussion Use this initializer to create a column of integers from another column. As an example, to create a column with this initializer, first start with a column that is convertible to integers. let stringColumn = MLUntypedColumn(["1", "2", "3", "4", "5"]) print(stringColumn) /* Prints...  ValueType: String  Values:        [1, 2, 3, 4, 5]  */ Then use init(ints:) to convert the column to a column of integers. let intsColumn = MLUntypedColumn(ints: stringColumn) print(intsColumn) /* Prints...  ValueType: Int  Values:        [1, 2, 3, 4, 5]  */

## See Also

### Creating an untyped column by converting another column

- [init(doubles:)](createml/mluntypedcolumn/init(doubles:).md)
- [init(strings:)](createml/mluntypedcolumn/init(strings:).md)
- [init(sequences:)](createml/mluntypedcolumn/init(sequences:).md)
- [init(dictionaries:)](createml/mluntypedcolumn/init(dictionaries:).md)
- [init(multiArrays:)](createml/mluntypedcolumn/init(multiarrays:).md)
