---
title: "randomSplit(by:seed:)"
framework: tabulardata
role: symbol
role_heading: Instance Method
path: "tabulardata/dataframeprotocol/randomsplit(by:seed:)"
---

# randomSplit(by:seed:)

Generates two data frame slices by randomly splitting the rows of the data table.

## Declaration

```swift
func randomSplit(by proportion: Double, seed: Int? = nil) -> (DataFrame.Slice, DataFrame.Slice)
```

## Parameters

- `proportion`: A proportion in the range [0.0, 1.0].
- `seed`: A seed number for a random-number generator.

## Return Value

Return Value A tuple of two data frame slices.

## See Also

### Creating Two Slices by Splitting Rows

- [randomSplit(by:using:)](tabulardata/dataframeprotocol/randomsplit(by:using:).md)
