---
title: "subscript(_:_:)"
framework: createml
role: symbol
role_heading: Instance Subscript
path: "createml/mldatatable/subscript(_:_:)"
---

# subscript(_:_:)

Retrieves a column with the specified name and type.

## Declaration

```swift
subscript<T>(columnName: String, columnType: T.Type) -> MLDataColumn<T>? where T : MLDataValueConvertible { get }
```

## Parameters

- `columnName`: The name of the column to extract.
- `columnType`: The underlying type of the column’s content.

## Return Value

Return Value A new MLDataColumn with the specified name and type, if it exists; otherwise nil.

## Overview

Overview Use this subscript to get a typed MLDataColumn, which is easier to work with than a MLUntypedColumn returned from subscript(_:).

## See Also

### Accessing columns

- [subscript(_:)](createml/mldatatable/subscript(_:).md)
