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

add filter and subset to documentation #2900

Merged
merged 4 commits into from
Oct 10, 2021
Merged

add filter and subset to documentation #2900

merged 4 commits into from
Oct 10, 2021

Conversation

bkamins
Copy link
Member

@bkamins bkamins commented Oct 7, 2021

This is a long standing missing part of the docs.

@bkamins bkamins added the doc label Oct 7, 2021
@bkamins bkamins added this to the 1.3 milestone Oct 7, 2021
@bkamins bkamins requested a review from nalimilan October 7, 2021 21:38
docs/src/man/working_with_dataframes.md Show resolved Hide resolved
- when using `.` (`getpropery`) notation (`df.A`),
- when a single row is selected using an integer (`df[1, [:A, :B]]`)
- when `view` or `@view` is used (e.g. `@view df[1:3, :A]`).

More details on copies, views, and references can be found
in the [`getindex` and `view`](@ref) section.

An alternative approach to row subsetting in a data frame is to use
[`filter`](@ref), [`filter!`](@ref), [`subset`](@ref), or [`subset!`](@ref)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we should advertise filter now that we have subset? The version taking a function is slow due to type instability, and the other one is similar to subset.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter is a bit faster. It is also easier to use in simple cases as you do not have to do broadcasting or using ByRow wrapper. But we can discuss this of course.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. But then at least maybe don't show the pair syntax with filter? Better only show it for functions which interpret it the same way (subset, transform...).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean that at this stage of the tutorial it would be too confusing to discuss it? In this case I would remove filter and only describe subset and just add a comment that there is also filter and that the reader can check it in the documentation. OK?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok - updated

docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
Co-authored-by: Milan Bouchet-Valat <[email protected]>
@bkamins
Copy link
Member Author

bkamins commented Oct 10, 2021

Thank you!

PS. Julia is easier than English 😄.

@bkamins bkamins merged commit 7705974 into main Oct 10, 2021
@bkamins bkamins deleted the bk/document_filtering branch October 10, 2021 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants