# Apparently incorrect error when going out of bounds on a dataframe

**URL:** <https://discourse.julialang.org/t/apparently-incorrect-error-when-going-out-of-bounds-on-a-dataframe/40622>\
**Category:** General Usage\
**Tags:** dataframes\
**Created:** [June 2, 2020, 4:46pm UTC](https://discourse.julialang.org/t/apparently-incorrect-error-when-going-out-of-bounds-on-a-dataframe/40622 "2020-06-02T16:46:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [June 2, 2020, 4:46pm UTC](https://discourse.julialang.org/t/apparently-incorrect-error-when-going-out-of-bounds-on-a-dataframe/40622/1 "2020-06-02T16:46:25Z")

</div>

```julia
julia> df=DataFrame(rand(3,3))
3×3 DataFrame
│ Row │ x1 │ x2 │ x3 │
│ │ Float64 │ Float64 │ Float64 │
├─────┼──────────┼──────────┼──────────┤
│ 1 │ 0.505311 │ 0.327654 │ 0.761537 │
│ 2 │ 0.69492 │ 0.743024 │ 0.430169 │
│ 3 │ 0.549926 │ 0.455567 │ 0.653309 │

julia> df[1,1]
0.5053108749208113

julia> df[4,1]
ERROR: BoundsError: attempt to access String
Stacktrace:
 [1] getindex(::DataFrame, ::Int64, ::Int64) at C:\Users\klaff\.julia\packages\DataFrames\S3ZFo\src\dataframe\dataframe.jl:314
 [2] top-level scope at none:0

julia>

```

I was confused by the “attempt to access String” part. When I look at dataframe.jl:314, it contains a different error message: `throw(BoundsError("attempt to access a data frame with $(nrow(df)) " * "rows at index $row_ind"))`, which would make much more sense.

Is this behavior repeatable for others or do I have something locally messed up?

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [June 2, 2020, 5:59pm UTC](https://discourse.julialang.org/t/apparently-incorrect-error-when-going-out-of-bounds-on-a-dataframe/40622/2 "2020-06-02T17:59:20Z")

</div>

I think this is fixed in the latest release, see [here](https://github.com/JuliaData/DataFrames.jl/pull/2069).

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [June 2, 2020, 6:31pm UTC](https://discourse.julialang.org/t/apparently-incorrect-error-when-going-out-of-bounds-on-a-dataframe/40622/3 "2020-06-02T18:31:41Z")

</div>

Thank you! Somehow I was stuck on an old version of DataFrames.
