---
title: DataFrame
framework: tabulardata
role: symbol
role_heading: Structure
path: tabulardata/dataframe
---

# DataFrame

A collection that arranges data in rows and columns.

## Declaration

```swift
@dynamicMemberLookup struct DataFrame
```

## Topics

### Creating a Data Frame

- [init()](tabulardata/dataframe/init().md)
- [init(columns:)](tabulardata/dataframe/init(columns:).md)
- [init(dictionaryLiteral:)](tabulardata/dataframe/init(dictionaryliteral:).md)

### Creating a Data Frame from Other Data Frames

- [init(_:)](tabulardata/dataframe/init(_:).md)
- [DataFrame.Slice](tabulardata/dataframe/slice.md)

### Creating a Data Frame from a JSON File

- [init(contentsOfJSONFile:columns:types:options:)](tabulardata/dataframe/init(contentsofjsonfile:columns:types:options:).md)
- [init(jsonData:columns:types:options:)](tabulardata/dataframe/init(jsondata:columns:types:options:).md)
- [JSONType](tabulardata/jsontype.md)
- [JSONReadingOptions](tabulardata/jsonreadingoptions.md)

### Creating a Data Frame from a CSV

- [init(contentsOfCSVFile:columns:rows:types:options:)](tabulardata/dataframe/init(contentsofcsvfile:columns:rows:types:options:).md)
- [init(csvData:columns:rows:types:options:)](tabulardata/dataframe/init(csvdata:columns:rows:types:options:).md)
- [CSVType](tabulardata/csvtype.md)
- [CSVReadingOptions](tabulardata/csvreadingoptions.md)

### Creating a Data Frame from Turi Create Types

- [init(contentsOfSFrameDirectory:columns:rows:)](tabulardata/dataframe/init(contentsofsframedirectory:columns:rows:).md)
- [ShapedData](tabulardata/shapeddata.md)

### Inspecting a Data Frame

- [shape](tabulardata/dataframe/shape.md)
- [columns](tabulardata/dataframe/columns.md)
- [rows](tabulardata/dataframe/rows-swift.property.md)
- [DataFrame.Rows](tabulardata/dataframe/rows-swift.struct.md)
- [base](tabulardata/dataframe/base.md)
- [containsColumn(_:_:)](tabulardata/dataframe/containscolumn(_:_:).md)

### Sorting a Data Frame

- [sort(on:order:)](tabulardata/dataframe/sort(on:order:)-4vns7.md)
- [sort(on:_:order:)](tabulardata/dataframe/sort(on:_:order:)-78avw.md)
- [sort(on:_:by:)](tabulardata/dataframe/sort(on:_:by:).md)
- [sort(on:by:)](tabulardata/dataframe/sort(on:by:).md)
- [sort(on:order:)](tabulardata/dataframe/sort(on:order:)-5ep7w.md)
- [sort(on:_:order:)](tabulardata/dataframe/sort(on:_:order:)-8wrkl.md)
- [sort(on:_:_:order:)](tabulardata/dataframe/sort(on:_:_:order:).md)

### Summarizing a Data Frame

- [summary()](tabulardata/dataframe/summary().md)
- [summary(of:)](tabulardata/dataframe/summary(of:).md)
- [summary(ofColumns:)](tabulardata/dataframe/summary(ofcolumns:).md)
- [SummaryColumnIDs](tabulardata/summarycolumnids.md)

### Saving a Data Frame to a CSV Format

- [CSVWritingOptions](tabulardata/csvwritingoptions.md)

### Describing a Data Frame

- [description](tabulardata/dataframe/description.md)
- [debugDescription](tabulardata/dataframe/debugdescription.md)
- [customMirror](tabulardata/dataframe/custommirror.md)

### Comparing Data Frames

- [==(_:_:)](tabulardata/dataframe/==(_:_:).md)

### Hashing a Data Frame

- [hash(into:)](tabulardata/dataframe/hash(into:).md)

### Initializers

- [init(_:featuresColumnID:annotationsColumnID:)](tabulardata/dataframe/init(_:featurescolumnid:annotationscolumnid:).md)
- [init(contentsOfCSVFile:columns:rows:options:)](tabulardata/dataframe/init(contentsofcsvfile:columns:rows:options:).md)
- [init(csvData:columns:rows:options:)](tabulardata/dataframe/init(csvdata:columns:rows:options:).md)

### Instance Methods

- [containsColumn(_:)](tabulardata/dataframe/containscolumn(_:)-6nqfs.md)
- [containsColumn(_:)](tabulardata/dataframe/containscolumn(_:)-8spst.md)
- [loadRangedAnnotations(parameters:continueOnFailure:)](tabulardata/dataframe/loadrangedannotations(parameters:continueonfailure:).md)
- [selecting(_:)](tabulardata/dataframe/selecting(_:).md)

### Subscripts

- [subscript(_:)](tabulardata/dataframe/subscript(_:)-4jbhp.md)
- [subscript(metric:)](tabulardata/dataframe/subscript(metric:).md)

### Default Implementations

- [CustomDebugStringConvertible Implementations](tabulardata/dataframe/customdebugstringconvertible-implementations.md)
- [CustomReflectable Implementations](tabulardata/dataframe/customreflectable-implementations.md)
- [CustomStringConvertible Implementations](tabulardata/dataframe/customstringconvertible-implementations.md)
- [DataFrameProtocol Implementations](tabulardata/dataframe/dataframeprotocol-implementations.md)
- [Equatable Implementations](tabulardata/dataframe/equatable-implementations.md)
- [ExpressibleByDictionaryLiteral Implementations](tabulardata/dataframe/expressiblebydictionaryliteral-implementations.md)
- [Hashable Implementations](tabulardata/dataframe/hashable-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [DataFrameProtocol](tabulardata/dataframeprotocol.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [ExpressibleByDictionaryLiteral](swift/expressiblebydictionaryliteral.md)
- [Hashable](swift/hashable.md)

## See Also

### Data Tables

- [DataFrameProtocol](tabulardata/dataframeprotocol.md)
