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

update docs following CSV.jl 0.9 release #2865

Merged
merged 9 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
788 changes: 398 additions & 390 deletions docs/src/man/basics.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src/man/querying_frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ The major benefit of the package is that it allows you to refer to columns of a
expressions. Additionally you can chain a sequence of transformations of a
`DataFrame` using the `@linq` macro.

When a DataFramesMeta.jl macro such as `@select`, `@transform`, `@by`, `@combine`,
When a DataFramesMeta.jl macro such as `@select`, `@transform`, `@by`, `@combine`,
`@where`, or `@orderby` is called inside a `@linq` block, you can omit
the `@`. Therefore `transform` inside `@linq` is not the same as `transform`
outside of a `@linq` block.
outside of a `@linq` block.

Here is a minimal example of usage of the package. Observe that we refer to
names of columns using only their names and that chaining is performed using the
Expand Down
22 changes: 11 additions & 11 deletions docs/src/man/reshaping_and_pivoting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ julia> iris = CSV.read((joinpath(dirname(pathof(DataFrames)),
DataFrame)
150×5 DataFrame
Row │ SepalLength SepalWidth PetalLength PetalWidth Species
│ Float64 Float64 Float64 Float64 String
│ Float64 Float64 Float64 Float64 String15
─────┼──────────────────────────────────────────────────────────────────
1 │ 5.1 3.5 1.4 0.2 Iris-setosa
2 │ 4.9 3.0 1.4 0.2 Iris-setosa
Expand All @@ -33,7 +33,7 @@ julia> iris = CSV.read((joinpath(dirname(pathof(DataFrames)),
julia> stack(iris, 1:4)
600×3 DataFrame
Row │ Species variable value
String String Float64
String15 String Float64
─────┼──────────────────────────────────────
1 │ Iris-setosa SepalLength 5.1
2 │ Iris-setosa SepalLength 4.9
Expand Down Expand Up @@ -62,7 +62,7 @@ be given:
julia> stack(iris, [:SepalLength, :SepalWidth, :PetalLength, :PetalWidth])
600×3 DataFrame
Row │ Species variable value
String String Float64
String15 String Float64
─────┼──────────────────────────────────────
1 │ Iris-setosa SepalLength 5.1
2 │ Iris-setosa SepalLength 4.9
Expand Down Expand Up @@ -100,7 +100,7 @@ the long format:
julia> stack(iris, [:SepalLength, :SepalWidth], :Species)
300×3 DataFrame
Row │ Species variable value
String String Float64
String15 String Float64
─────┼──────────────────────────────────────
1 │ Iris-setosa SepalLength 5.1
2 │ Iris-setosa SepalLength 4.9
Expand All @@ -127,7 +127,7 @@ If you prefer to specify the id columns then use `Not` with `stack` like this:
julia> stack(iris, Not(:Species))
600×3 DataFrame
Row │ Species variable value
String String Float64
String15 String Float64
─────┼──────────────────────────────────────
1 │ Iris-setosa SepalLength 5.1
2 │ Iris-setosa SepalLength 4.9
Expand Down Expand Up @@ -159,7 +159,7 @@ julia> iris.id = 1:size(iris, 1)
julia> longdf = stack(iris, Not([:Species, :id]))
600×4 DataFrame
Row │ Species id variable value
String Int64 String Float64
String15 Int64 String Float64
─────┼─────────────────────────────────────────────
1 │ Iris-setosa 1 SepalLength 5.1
2 │ Iris-setosa 2 SepalLength 4.9
Expand Down Expand Up @@ -209,7 +209,7 @@ If the remaining columns are unique, you can skip the id variable and use:
julia> unstack(longdf, :variable, :value)
150×6 DataFrame
Row │ Species id SepalLength SepalWidth PetalLength PetalWidth ⋯
String Int64 Float64? Float64? Float64? Float64? ⋯
String15 Int64 Float64? Float64? Float64? Float64? ⋯
─────┼──────────────────────────────────────────────────────────────────────────
1 │ Iris-setosa 1 5.1 3.5 1.4 0.2 ⋯
2 │ Iris-setosa 2 4.9 3.0 1.4 0.2
Expand All @@ -236,7 +236,7 @@ arguments, as they will be used by default, and write:
julia> unstack(longdf)
150×6 DataFrame
Row │ Species id SepalLength SepalWidth PetalLength PetalWidth ⋯
String Int64 Float64? Float64? Float64? Float64? ⋯
String15 Int64 Float64? Float64? Float64? Float64? ⋯
─────┼──────────────────────────────────────────────────────────────────────────
1 │ Iris-setosa 1 5.1 3.5 1.4 0.2 ⋯
2 │ Iris-setosa 2 4.9 3.0 1.4 0.2
Expand Down Expand Up @@ -264,7 +264,7 @@ the original wide data frame. Here is an example:
julia> stack(iris, view=true)
600×4 DataFrame
Row │ Species id variable value
String Int64 String Float64
String15 Int64 String Float64
─────┼─────────────────────────────────────────────
1 │ Iris-setosa 1 SepalLength 5.1
2 │ Iris-setosa 2 SepalLength 4.9
Expand Down Expand Up @@ -306,7 +306,7 @@ julia> using Statistics
julia> d = stack(iris, Not(:Species))
750×3 DataFrame
Row │ Species variable value
String String Float64
String15 String Float64
─────┼──────────────────────────────────────
1 │ Iris-setosa SepalLength 5.1
2 │ Iris-setosa SepalLength 4.9
Expand All @@ -329,7 +329,7 @@ julia> d = stack(iris, Not(:Species))
julia> x = combine(groupby(d, [:variable, :Species]), :value => mean => :vsum)
15×3 DataFrame
Row │ variable Species vsum
│ String String Float64
│ String String15 Float64
─────┼───────────────────────────────────────
1 │ SepalLength Iris-setosa 5.006
2 │ SepalLength Iris-versicolor 5.936
Expand Down
14 changes: 7 additions & 7 deletions docs/src/man/sorting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ julia> iris = CSV.read((joinpath(dirname(pathof(DataFrames)),
DataFrame)
150×5 DataFrame
Row │ SepalLength SepalWidth PetalLength PetalWidth Species
│ Float64 Float64 Float64 Float64 String
│ Float64 Float64 Float64 Float64 String15
─────┼──────────────────────────────────────────────────────────────────
1 │ 5.1 3.5 1.4 0.2 Iris-setosa
2 │ 4.9 3.0 1.4 0.2 Iris-setosa
Expand All @@ -33,7 +33,7 @@ julia> iris = CSV.read((joinpath(dirname(pathof(DataFrames)),
julia> sort!(iris)
150×5 DataFrame
Row │ SepalLength SepalWidth PetalLength PetalWidth Species
│ Float64 Float64 Float64 Float64 String
│ Float64 Float64 Float64 Float64 String15
─────┼──────────────────────────────────────────────────────────────────
1 │ 4.3 3.0 1.1 0.1 Iris-setosa
2 │ 4.4 2.9 1.4 0.2 Iris-setosa
Expand Down Expand Up @@ -65,7 +65,7 @@ Here are some examples showing most of the possible options:
julia> sort!(iris, rev = true)
150×5 DataFrame
Row │ SepalLength SepalWidth PetalLength PetalWidth Species
│ Float64 Float64 Float64 Float64 String
│ Float64 Float64 Float64 Float64 String15
─────┼──────────────────────────────────────────────────────────────────
1 │ 7.9 3.8 6.4 2.0 Iris-virginica
2 │ 7.7 3.8 6.7 2.2 Iris-virginica
Expand All @@ -88,7 +88,7 @@ julia> sort!(iris, rev = true)
julia> sort!(iris, [:Species, :SepalWidth])
150×5 DataFrame
Row │ SepalLength SepalWidth PetalLength PetalWidth Species
│ Float64 Float64 Float64 Float64 String
│ Float64 Float64 Float64 Float64 String15
─────┼──────────────────────────────────────────────────────────────────
1 │ 4.5 2.3 1.3 0.3 Iris-setosa
2 │ 4.4 2.9 1.4 0.2 Iris-setosa
Expand All @@ -111,7 +111,7 @@ julia> sort!(iris, [:Species, :SepalWidth])
julia> sort!(iris, [order(:Species, by=length), order(:SepalLength, rev=true)])
150×5 DataFrame
Row │ SepalLength SepalWidth PetalLength PetalWidth Species
│ Float64 Float64 Float64 Float64 String
│ Float64 Float64 Float64 Float64 String15
─────┼───────────────────────────────────────────────────────────────────
1 │ 5.8 4.0 1.2 0.2 Iris-setosa
2 │ 5.7 3.8 1.7 0.3 Iris-setosa
Expand Down Expand Up @@ -148,7 +148,7 @@ rows will be sorted by increasing `:PetalLength`:
julia> sort!(iris, [:Species, :PetalLength], rev=(true, false))
150×5 DataFrame
Row │ SepalLength SepalWidth PetalLength PetalWidth Species
│ Float64 Float64 Float64 Float64 String
│ Float64 Float64 Float64 Float64 String15
─────┼──────────────────────────────────────────────────────────────────
1 │ 4.9 2.5 4.5 1.7 Iris-virginica
2 │ 6.2 2.8 4.8 1.8 Iris-virginica
Expand All @@ -171,7 +171,7 @@ julia> sort!(iris, [:Species, :PetalLength], rev=(true, false))
julia> sort!(iris, [order(:Species, rev=true), :PetalLength])
150×5 DataFrame
Row │ SepalLength SepalWidth PetalLength PetalWidth Species
│ Float64 Float64 Float64 Float64 String
│ Float64 Float64 Float64 Float64 String15
─────┼──────────────────────────────────────────────────────────────────
1 │ 4.9 2.5 4.5 1.7 Iris-virginica
2 │ 6.2 2.8 4.8 1.8 Iris-virginica
Expand Down
Loading