# Access DataFrames index

**URL:** <https://discourse.julialang.org/t/access-dataframes-index/79342>\
**Category:** General Usage\
**Tags:** question, dataframes\
**Created:** [April 11, 2022, 12:12pm UTC](https://discourse.julialang.org/t/access-dataframes-index/79342 "2022-04-11T12:12:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [April 11, 2022, 12:12pm UTC](https://discourse.julialang.org/t/access-dataframes-index/79342/1 "2022-04-11T12:12:38Z")

</div>

I’m sure this a trivial task but I cannot find the answer. I have a Julia DataFrame and I’d like the index as an array, in pandas I can do:

```python
>>> import pandas as pd
>>> df = pd.DataFrame([1,2,3,4,5])
>>> df.index
RangeIndex(start=0, stop=5, step=1)
>>> list(df.index)
[0, 1, 2, 3, 4]

```

How can I do this in Julia?

Or in Julia DataFrames can we only have range indices, making `1:length(df)` the best option?

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [April 11, 2022, 12:22pm UTC](https://discourse.julialang.org/t/access-dataframes-index/79342/2 "2022-04-11T12:22:18Z")

</div>

DataFrames.jl does not support row names currently (if this is what you are looking for). To get each row index use either `1:nrow(df)` or `axes(df, 1)`.
