---
title: ColumnConcatenator
framework: createmlcomponents
role: symbol
role_heading: Structure
path: createmlcomponents/columnconcatenator
---

# ColumnConcatenator

A transformer that concatenates every numerical column in a dataframe into to a shaped array for each row.

## Declaration

```swift
struct ColumnConcatenator<Scalar> where Scalar : MLShapedArrayScalar, Scalar : BinaryFloatingPoint
```

## Overview

Overview The resulting concatenated column contains MLShapedArray<Scalar> elements. For example ┏━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┓ ┃   ┃ label    ┃ price   ┃ rooms ┃ A     ┃ B     ┃ C     ┃ ┃   ┃ <String> ┃ <Int>   ┃ <Int> ┃ <Int> ┃ <Int> ┃ <Int> ┃ ┡━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━┩ │ 0 │ good     │ 850,000 │     4 │     1 │     0 │     0 │ │ 1 │ bad      │ 700,000 │     3 │     0 │     1 │     0 │ │ 2 │ bad      │ 650,000 │     3 │     0 │     0 │     1 │ │ 3 │ good     │ 600,000 │     2 │     0 │     1 │     0 │ └───┴──────────┴─────────┴───────┴───────┴───────┴───────┘ would be concatenated as: ┏━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃   ┃ label    ┃ features               ┃ ┃   ┃ <String> ┃ <MLShapedArray<Float>> ┃ ┡━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩ │ 0 │ good     │ [850,000, 4, 1, 0, 0]  │ │ 1 │ bad      │ [700,000, 3, 0, 1, 0]  │ │ 2 │ bad      │ [650,000, 3, 0, 0, 1]  │ │ 3 │ good     │ [600,000, 2, 0, 1, 0]  │ └───┴──────────┴────────────────────────┘ Non-numerical columns are left in the data frame unchanged. Supported numeric types are Int, UInt8, Float, and Double. Arrays and shaped arrays of those types as supported, but every array in a given column must have the same shape and shaped arrays across columns must have the same shape except for the last dimension.

## Topics

### Creating the concatenator

- [init(columnSelection:concatenatedColumnName:)](createmlcomponents/columnconcatenator/init(columnselection:concatenatedcolumnname:).md)

### Getting the properties

- [columnSelection](createmlcomponents/columnconcatenator/columnselection.md)
- [concatenatedColumnName](createmlcomponents/columnconcatenator/concatenatedcolumnname.md)

### Applying

- [applied(to:eventHandler:)](createmlcomponents/columnconcatenator/applied(to:eventhandler:).md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Escapable](swift/escapable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [TabularTransformer](createmlcomponents/tabulartransformer.md)
- [Transformer](createmlcomponents/transformer.md)

## See Also

### Tabular components

- [TabularTransformer](createmlcomponents/tabulartransformer.md)
- [TabularEstimator](createmlcomponents/tabularestimator.md)
- [SupervisedTabularEstimator](createmlcomponents/supervisedtabularestimator.md)
- [ColumnSelector](createmlcomponents/columnselector.md)
- [ColumnSelectorTransformer](createmlcomponents/columnselectortransformer.md)
- [ColumnSelection](createmlcomponents/columnselection.md)
- [PreprocessingSupervisedTabularEstimator](createmlcomponents/preprocessingsupervisedtabularestimator.md)
- [PreprocessingTabularEstimator](createmlcomponents/preprocessingtabularestimator.md)
- [PreprocessingUpdatableSupervisedTabularEstimator](createmlcomponents/preprocessingupdatablesupervisedtabularestimator.md)
- [PreprocessingUpdatableTabularEstimator](createmlcomponents/preprocessingupdatabletabularestimator.md)
