<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabularData",
  "identifier" : "/documentation/TabularData/DataFrameProtocol/stratifiedSplit(on:_:_:by:randomSeed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "TabularData"
    ],
    "preciseIdentifier" : "s:11TabularData0B13FrameProtocolPAAE15stratifiedSplit2on__2by10randomSeedAA0bC0V_AItAA8ColumnIDVyqd__G_AKyqd_0_GAKyqd_1_GSdSiSgtSHRd__SHRd_0_SHRd_1_r1_lF"
  },
  "title" : "stratifiedSplit(on:_:_:by:randomSeed:)"
}
-->

# stratifiedSplit(on:_:_:by:randomSeed:)

Generates two data frames by randomly splitting the rows of three columns,
which you select by column identifiers, into strata.

```
func stratifiedSplit<T0, T1, T2>(on columnID0: ColumnID<T0>, _ columnID1: ColumnID<T1>, _ columnID2: ColumnID<T2>, by proportion: Double, randomSeed: Int? = nil) -> (DataFrame, DataFrame) where T0 : Hashable, T1 : Hashable, T2 : Hashable
```

## Parameters

`columnID0`

A column identifier.

`columnID1`

A second column identifier.

`columnID2`

A third column identifier.

`proportion`

A proportion in the range `[0.0, 1.0]`.

`randomSeed`

A seed number for a random-number generator.

## Return Value

A tuple of two data frames.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)