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

fix documentation examples #1946

Merged
merged 3 commits into from
Sep 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/src/man/reshaping_and_pivoting.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ This repeats the original columns N times where N is the number of columns stack
None of these reshaping functions perform any aggregation. To do aggregation, use the split-apply-combine functions in combination with reshaping. Here is an example:

```jldoctest reshape
julia> using Statistics

julia> d = melt(iris, :Species);

julia> first(d, 6)
Expand Down
3 changes: 2 additions & 1 deletion docs/src/man/sorting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Sorting is a fundamental component of data analysis. Basic sorting is trivial: j
```jldoctest sort
julia> using DataFrames, CSV

julia> iris = CSV.read(joinpath(dirname(pathof(DataFrames)), "../docs/src/assets/iris.csv"));
julia> iris = CSV.File(joinpath(dirname(pathof(DataFrames)), "../docs/src/assets/iris.csv")) |>
Copy link
Member

Choose a reason for hiding this comment

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

Better use the more common syntax DataFrame(...)? That will avoid confusing newcomers.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed (although in my codes I use the File pattern 😄)

Copy link
Member

Choose a reason for hiding this comment

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

No, I meant using DataFrame(CSV.File(...)) instead of |>.

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. Let us stick with CSV.read with copycols=true (what I pushed now) as it is also a pattern that is good to show I think.

Copy link
Member

Choose a reason for hiding this comment

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

I prefer DataFrame(CSV.File(...)), as it makes it less likely that people will call CSV.read and forget to pass copycols=true. Actually I'd rather get rid of CSV.read.

BTW, there are other occurrences in the docs IIRC, better change all of them at the same time.

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 - done. At least we agree what should be used 😄.

DataFrame;

julia> first(iris, 4)
4×5 DataFrame
Expand Down