# xs

> For the complete documentation index, see [llms.txt](https://kotlin.github.io/dataframe/llms.txt).

Return cross-section from the [DataFrame](dataframe.html).

API reference: [xs](https://kotlin.github.io/dataframe/api-docs/core/org.jetbrains.kotlinx.dataframe.api/xs.html)

Filters [DataFrame](dataframe.html) by matching key values with key columns and removes key columns.

```
xs(vararg keyValues: Any?)
     [ { keyColumns } ]
```

When `keyColumns` are not specified, it takes the first `n` columns in depth-first order (looking inside [ColumnGroup](datacolumn.html#columngroup)), where `n` is the number of given `keyValues`.

```KOTLIN
df.xs("Charlie", "Chaplin")

df.xs("Moscow", true) { city and isHappy }
```

[Embedded content](resources/org.jetbrains.kotlinx.dataframe.samples.api.Access.xs.html)

