DataFrames.jl icon indicating copy to clipboard operation
DataFrames.jl copied to clipboard

Updated Basic Usage of Transformation Functions

Open nathanrboyer opened this issue 4 years ago • 9 comments

Documentation update related to #2866. This is a work in progress and my first pull request. Contributions welcome.

nathanrboyer avatar Oct 12 '21 19:10 nathanrboyer

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 in ByRow like +function = ByRow(my_elementwise_function), +which will conveniently collect your element-wise function results +into a Vector. +When multiple columns are selected, +the function will receive the columns as multiple arguments in the +order they are selected like function(column1, column2, column3). +Alternatively, the selected columns can be "slurped" into a +single argument using function(columns...). +In more advanced usage, the function itself can use column selectors +in its definition.

+new_column_name may be a String or a Symbol. +(Soon new_column_name will 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.

nathanrboyer avatar Nov 08 '21 14:11 nathanrboyer

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.

nathanrboyer avatar Nov 08 '21 15:11 nathanrboyer

Thank you - please just mark the PR "Ready for review" when you are happy with it.

bkamins avatar Nov 08 '21 17:11 bkamins

@nathanrboyer - please let me know when you are done then I will review.

bkamins avatar Jan 24 '22 07:01 bkamins

@bkamins Ready for review!

nathanrboyer avatar Jan 25 '22 14:01 nathanrboyer

@nathanrboyer - what is the status of this PR?

bkamins avatar Feb 20 '22 12:02 bkamins

Waiting for input from @pdeffebach and @nalimilan to reach a consensus on terminology. https://github.com/JuliaData/DataFrames.jl/pull/2907#discussion_r792872612

nathanrboyer avatar Feb 22 '22 13:02 nathanrboyer

I agree with @bkamins that operation is the word to use here. I have adapted the same convention in the DataFramesMeta.jl documentation.

pdeffebach avatar Feb 22 '22 19:02 pdeffebach

@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.

bkamins avatar Jun 12 '22 18:06 bkamins

@nathanrboyer - it is still a draft. Right?

bkamins avatar Jul 04 '23 05:07 bkamins

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?

nathanrboyer avatar Jul 05 '23 13:07 nathanrboyer

No - pushing is OK. Then I will ignore changes in this PR until it is marked as ready for review. Thank you!

bkamins avatar Jul 05 '23 15:07 bkamins

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!

nathanrboyer avatar Jul 16 '23 20:07 nathanrboyer

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)

bkamins avatar Jul 16 '23 21:07 bkamins