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

Allow out of bounds indices in Not #17

Closed
bkamins opened this issue Apr 16, 2020 · 2 comments
Closed

Allow out of bounds indices in Not #17

bkamins opened this issue Apr 16, 2020 · 2 comments

Comments

@bkamins
Copy link
Member

bkamins commented Apr 16, 2020

Originally posted at JuliaData/DataFrames.jl#2197.

The question is should we allow the following code:

julia> x = [1,2,3]
3-element Array{Int64,1}:
 1
 2
 3

julia> x[Not(4)]
ERROR: BoundsError: attempt to access 3-element Array{Int64,1} at index [Not(4)]

to work (and in this case just return [1,2,3]) instead of throwing an error?

@bkamins bkamins changed the title Allow invalid indices in Not Allow out of bounds indices in Not Apr 16, 2020
@mbauman
Copy link
Collaborator

mbauman commented Apr 16, 2020

Personally, I'm in favor of the status quo, but I agree the DataFrame column name feels different than an out-of-bounds index.

@bkamins
Copy link
Member Author

bkamins commented Apr 16, 2020

OK - we can change it only for column names. Thank you!

@bkamins bkamins closed this as completed Apr 16, 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