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

# DataFrame.Slice

A set of a data frame’s rows you create by using a method from a data frame instance or another data frame slice.

## Declaration

```swift
@dynamicMemberLookup struct Slice
```

## Overview

Overview A slice is an arbitrary set of rows from a data frame. For example, a slice might contain rows 0–3, 5–9, and 101 from its underlying data frame.

## Topics

### Inspecting a Slice

- [shape](tabulardata/dataframe/slice/shape.md)
- [columns](tabulardata/dataframe/slice/columns.md)
- [rows](tabulardata/dataframe/slice/rows.md)
- [base](tabulardata/dataframe/slice/base.md)

### Creating a Slice by Selecting a Column

- [subscript(_:)](tabulardata/dataframe/slice/subscript(_:)-32h9z.md)
- [subscript(column:_:)](tabulardata/dataframe/slice/subscript(column:_:).md)
- [subscript(_:_:)](tabulardata/dataframe/slice/subscript(_:_:).md)
- [subscript(_:)](tabulardata/dataframe/slice/subscript(_:)-18kdy.md)
- [subscript(dynamicMember:)](tabulardata/dataframe/slice/subscript(dynamicmember:).md)

### Creating a Slice by Selecting Multiple Columns

- [subscript(_:)](tabulardata/dataframe/slice/subscript(_:)-5y42o.md)
- [selecting(columnNames:)](tabulardata/dataframe/slice/selecting(columnnames:)-9l8oe.md)
- [selecting(columnNames:)](tabulardata/dataframe/slice/selecting(columnnames:)-48kji.md)

### Creating a Slice by Selecting Rows

- [prefix(_:)](tabulardata/dataframe/slice/prefix(_:).md)
- [prefix(upTo:)](tabulardata/dataframe/slice/prefix(upto:).md)
- [prefix(through:)](tabulardata/dataframe/slice/prefix(through:).md)
- [suffix(_:)](tabulardata/dataframe/slice/suffix(_:).md)
- [suffix(from:)](tabulardata/dataframe/slice/suffix(from:).md)

### Creating a Slice by Filtering Rows

- [filter(on:_:)](tabulardata/dataframe/slice/filter(on:_:).md)
- [filter(on:_:_:)](tabulardata/dataframe/slice/filter(on:_:_:).md)

### Grouping Rows

- [RowGrouping](tabulardata/rowgrouping.md)
- [grouped(by:)](tabulardata/dataframe/slice/grouped(by:).md)
- [RowGroupingProtocol](tabulardata/rowgroupingprotocol.md)

### Summarizing a Slice

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

### Comparing Slices

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

### Describing a Slice

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

### Hashing a Slice

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

### Default Implementations

- [CustomDebugStringConvertible Implementations](tabulardata/dataframe/slice/customdebugstringconvertible-implementations.md)
- [CustomReflectable Implementations](tabulardata/dataframe/slice/customreflectable-implementations.md)
- [CustomStringConvertible Implementations](tabulardata/dataframe/slice/customstringconvertible-implementations.md)
- [Equatable Implementations](tabulardata/dataframe/slice/equatable-implementations.md)
- [Hashable Implementations](tabulardata/dataframe/slice/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)
- [Hashable](swift/hashable.md)

## See Also

### Creating a Data Frame from Other Data Frames

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