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

# randomSplit(by:seed:)

Generates two row groupings by randomly splitting the original with a proportion and a seed number.

## Declaration

```swift
func randomSplit(by proportion: Double, seed: Int? = nil) -> (RowGrouping<GroupingKey>, RowGrouping<GroupingKey>)
```

## 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 row groupings.
