Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unrelated error message when trying to access 0 index #2182

Closed
anandijain opened this issue Apr 11, 2020 · 1 comment
Closed

unrelated error message when trying to access 0 index #2182

anandijain opened this issue Apr 11, 2020 · 1 comment

Comments

@anandijain
Copy link
Contributor

I saw #2123 but this was for OffsetArray.jl.

If you have a DataFrame and try to access index zero (common coming from python), like so:

df = DataFrame(:A => 1:150)
df[0:50, :] 

It correctly gives bound error, but says attempt to access String. I was wondering what the logic behind this is.
When indexing zero-th element for normal array in julia, it returns BoundsError: attempt to access 150-element UnitRange{Int64} at index [0].

Responding with the index [0] immediately reminds me of my mistake.

@bkamins
Copy link
Member

bkamins commented Apr 11, 2020

This is fixed on master.

julia> df[0:50, :] 
ERROR: BoundsError: attempt to access 150×1 DataFrame
  at index [0:50, Colon()]

@bkamins bkamins closed this as completed Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants