# Indexing

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

API reference: [DataFrame](https://kotlin.github.io/dataframe/api-docs/core/org.jetbrains.kotlinx.dataframe/-data-frame/index.html), [DataRow](https://kotlin.github.io/dataframe/api-docs/core/org.jetbrains.kotlinx.dataframe/-data-row/index.html)

The examples on this page use the following [DataFrame](dataframe.html):

```KOTLIN
df
```

[Embedded content](./resources/indexingDf.html)

## Access a cell by index

Properties:

```KOTLIN
df.age[1]
df[1].age
```

Strings:

```KOTLIN
df["age"][1]
df[1]["age"]
```

## Row indices

`indices()` returns the indices of all rows of the [DataFrame](dataframe.html) as an `IntRange` — from `0` to the number of rows minus one:

```KOTLIN
df.indices() // 0..9
```

Pass a [row condition](datarow.html#row-conditions) to get only the indices of the rows that satisfy it, as a `List<Int>` in row order:

Properties:

```KOTLIN
val moscow = df.indices { city == "Moscow" } // [2, 6]
```

Strings:

```KOTLIN
val moscow = df.indices { "city"<String?>() == "Moscow" } // [2, 6]
```

Use the result to [slice those rows](slicerows.html) out of the dataframe:

```KOTLIN
df.getRows(df.indices { city == "Moscow" })
```

[Embedded content](./resources/indicesGetRows.html)

See also [rowsCount](rowscount.html), which returns how many rows there are rather than their indices, and [filter](filter.html), which returns the matching rows themselves.

