-
Notifications
You must be signed in to change notification settings - Fork 368
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
target setindex implementation #1899
Conversation
I'd say it's fine to be restrictive for now. In particular, creating columns while providing names in an order different from the actual order sounds really weird. Let's start with a simple system, and possibly extend it later if we get requests. |
So the "restrictive" approach is to disallow adding columns using |
Co-Authored-By: Milan Bouchet-Valat <nalimilan@club.fr>
@nalimilan - this should be good to have a look at when you have some free time |
Co-Authored-By: Milan Bouchet-Valat <nalimilan@club.fr>
Yes - unfortunately if we want to keep the deprecations it is much easier to do it this way. The problem is, as discussed some time ago that using After the deprecations are removed from code base, we can revert to the standard |
This should be good for a second round of a review (probably there will be some comments - I tried to clean up everything, but the PR grew big). Thank you! |
Co-Authored-By: Milan Bouchet-Valat <nalimilan@club.fr>
Regarding
The What do you think would be better? |
I'd be fine with restricting as you suggest. But better make a new PR? |
But for The only question is if we should "math dimensionality" (so accept only For |
I don't have a strong opinion really. |
OK - I will go with what Base allows for Arrays (any dimensionality) then. |
@nalimilan - merged. Thank you! |
This is currently WIP (I have initially implemented new rules for things that we need to change to finish deprecations). It is not finalized yet, so have a look at it only to check what is added 😄.
Before I write tests and clean this up I would like to clarify what we do with
df[!, cols] = v
anddf[!, cols] .= v
syntax.The particular, crucial, question is if we want to allow them to create columns (like
df[!, col]
allows) or not. If yes then the question is if we allow adding columns only at the end of a data frame or also reorder the columns already present.The relevant case is for example:
Do we want column
:c
to be created, and if yes should it be a last column ofdf
(probably yes).My problem is that the corner-cases will be surprising for users, so, as opposed to single column assignment, maybe it should be disallowed to add columns (but maybe you feel it is OK).