Updated Basic Usage of Transformation Functions
Documentation update related to #2866. This is a work in progress and my first pull request. Contributions welcome.
I think that is fine and easy enough to work around. I just wanted to make sure I documented correctly.
On Nov 8, 2021, at 8:53 AM, Bogumił Kamiński @.***> wrote:
@bkamins commented on this pull request.
In docs/src/man/basics.md:
+column passed as type
Vector. +If you instead want to apply a function to each element in the column, +then you can wrap your element-wise function inByRowlike +function = ByRow(my_elementwise_function), +which will conveniently collect your element-wise function results +into aVector. +When multiple columns are selected, +thefunctionwill receive the columns as multiple arguments in the +order they are selected likefunction(column1, column2, column3). +Alternatively, the selected columns can be "slurped" into a +single argument usingfunction(columns...). +In more advanced usage, thefunctionitself can use column selectors +in its definition.
+
new_column_namemay be aStringor aSymbol. +(Soonnew_column_namewill also accept a renaming function.) the a => b renaming limitation.If you pass one column (as this is what you do) just write a => identity => b or just a => newname(string(a)).
The function interface is intended for the cases where you rather perform multiple transformations in one shot.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I am pretty much done updating the Basic Usage of Transformation Functions section. I will work on the Broadcasting with Transformation Functions section next when I find some time.
Thank you - please just mark the PR "Ready for review" when you are happy with it.
@nathanrboyer - please let me know when you are done then I will review.
@bkamins Ready for review!
@nathanrboyer - what is the status of this PR?
Waiting for input from @pdeffebach and @nalimilan to reach a consensus on terminology. https://github.com/JuliaData/DataFrames.jl/pull/2907#discussion_r792872612
I agree with @bkamins that operation is the word to use here. I have adapted the same convention in the DataFramesMeta.jl documentation.
@nathanrboyer - I am removing a milestone from this PR. The reason is that we are making a lot of changes before the 1.4 release so this PR probably will not be finished very soon.
Of course once you come back to it we will merge it.
@nathanrboyer - it is still a draft. Right?
Yes, sorry. I just picked up working on it again. I was hoping it wouldn't alert you yet. Should I avoid git push to my fork until I'm finished?
No - pushing is OK. Then I will ignore changes in this PR until it is marked as ready for review. Thank you!
basics.md contains the only content changes.
notes.md contains questions I had while writing. The answers to some of these questions should be added to the documentation or to pull requests.
The other changed files should be discarded. I will need help figuring out the correct Git process to get this branch compatible again with master.
Feedback and reorganization welcome, thanks!
I answered all your questions in notes.md.
What I think will be simplest for you is to create a new branch from current main and make a new PR (later we will close this one and just work on a new one). This will be least work on your side I think. In that new PR please include only the things that should be merged (and we can use this PR of discussion on things you want to ask)