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

# randomSplit(by:seed:)

Generates two row groupings by randomly splitting the original by a proportion.

## Declaration

```swift
func randomSplit(by proportion: Double, seed: Int?) -> (Self, Self)
```

## 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 row grouping types.

## See Also

### Splitting a Row Grouping

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