<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: 18.4.0 -",
    "macOS: 15.4.0 -",
    "tvOS: 18.4.0 -",
    "visionOS: 2.4.0 -",
    "watchOS: 11.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabularData",
  "identifier" : "/documentation/TabularData/DataFrame/init(csvData:columns:rows:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "TabularData"
    ],
    "preciseIdentifier" : "s:11TabularData0B5FrameV03csvB07columns4rows7optionsAC10Foundation0B0V_AA8ColumnIDVyxGxQpSnySiGSgAA17CSVReadingOptionsVtKcRvzlufc"
  },
  "title" : "init(csvData:columns:rows:options:)"
}
-->

# init(csvData:columns:rows:options:)

Creates a data frame from CSV data.

```
init<each T>(csvData data: Data, columns: repeat ColumnID<each T>, rows: Range<Int>? = nil, options: CSVReadingOptions = .init()) throws
```

## Parameters

`data`

The contents of a CSV file.

`columns`

The column identifiers.

`rows`

A range of indices; Set to `nil` to use every row in the CSV file.

`options`

The options that tell the data frame how to read the CSV data.

---

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)