---
title: "stratifiedSplit(on:by:randomSeed:)"
framework: tabulardata
role: symbol
role_heading: Instance Method
path: "tabulardata/dataframeprotocol/stratifiedsplit(on:by:randomseed:)-8szu1"
---

# stratifiedSplit(on:by:randomSeed:)

Generates two data frames by randomly splitting the rows of multiple columns, which you select by their names, into strata.

## Declaration

```swift
func stratifiedSplit(on columnNames: String..., by proportion: Double, randomSeed: Int? = nil) -> (DataFrame, DataFrame)
```

## Parameters

- `columnNames`: A comma-separated, or variadic, list of column names.
- `proportion`: A proportion in the range [0.0, 1.0].
- `randomSeed`: A seed number for a random-number generator.

## Return Value

Return Value A tuple of two data frames.

## See Also

### Creating Two Data Frames by Splitting Rows

- [stratifiedSplit(on:by:randomSeed:)](tabulardata/dataframeprotocol/stratifiedsplit(on:by:randomseed:)-9iauf.md)
- [stratifiedSplit(on:by:randomSeed:)](tabulardata/dataframeprotocol/stratifiedsplit(on:by:randomseed:)-714jk.md)
- [stratifiedSplit(on:_:by:randomSeed:)](tabulardata/dataframeprotocol/stratifiedsplit(on:_:by:randomseed:).md)
- [stratifiedSplit(on:_:_:by:randomSeed:)](tabulardata/dataframeprotocol/stratifiedsplit(on:_:_:by:randomseed:).md)
