<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabularData",
  "identifier" : "/documentation/TabularData/DataFrame/insert(column:at:)-784jb",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "TabularData"
    ],
    "preciseIdentifier" : "s:11TabularData0B5FrameV6insert6column2atyAA9AnyColumnV_SitF"
  },
  "title" : "insert(column:at:)"
}
-->

# insert(column:at:)

Adds a type-erased column at a position in the data frame.

```
mutating func insert(column: AnyColumn, at index: Int)
```

## Parameters

`column`

A type-erased column.
The column must have the same number of rows as the data frame,
and must not have the same name as another column in the data frame.

`index`

A column position in the data frame.

## Discussion

The method inserts the new column before the column currently at `index`.
If you pass the array’s `shape.column` property as the `index` parameter,
the method appends the new column to the data frame.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)