Skip to content

Commit

Permalink
Change α to apple and make consistent with #3380
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanrboyer committed Sep 21, 2023
1 parent 2e9d2af commit b0777b1
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions docs/src/man/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2108,29 +2108,29 @@ julia> df = DataFrame(a=1:4, b=5:8)
33 7
44 8

julia> transform(df, :a => :α) # adds column α
julia> transform(df, :a => :apple) # adds column `apple`
4×3 DataFrame
Row │ a b α
Row │ a b apple
│ Int64 Int64 Int64
─────┼─────────────────────
11 5 1
22 6 2
33 7 3
44 8 4

julia> select(df, :a => :α) # retains only column α
julia> select(df, :a => :apple) # retains only column `apple`
4×1 DataFrame
Row │ α
Row │ apple
│ Int64
─────┼───────
11
22
33
44

julia> rename(df, :a => :α) # renames column α in-place
julia> rename(df, :a => :apple) # renames column `a` to `apple` in-place
4×2 DataFrame
Row │ α b
Row │ apple b
│ Int64 Int64
─────┼──────────────
11 5
Expand Down Expand Up @@ -2207,28 +2207,25 @@ it is probably again more useful to use the `rename` or `rename!` function
rather than one of the manipulation functions
in order to rename in-place and avoid the intermediate `operation_function`.
```julia
julia> rename(df, :a => add_prefix) # rename one column
julia> rename(add_prefix, df) # rename all columns with a function
4×2 DataFrame
Row │ new_a b
│ Int64 Int64
Row │ new_a new_b
│ Int64 Int64
─────┼──────────────
11 5
22 6
33 7
44 8

julia> rename(add_prefix, df) # rename all columns
julia> rename(add_prefix, df; cols=:a) # rename some columns with a function
4×2 DataFrame
Row │ new_a new_b
│ Int64 Int64
Row │ new_a b
│ Int64 Int64
─────┼──────────────
11 5
22 6
33 7
44 8

# Broadcasting syntax can be used to rename only some columns.
# See the Broadcasting Operation Pairs section below.
```

In the `source_column_selector => new_column_names` operation form,
Expand Down

0 comments on commit b0777b1

Please sign in to comment.