Skip to content

Commit 1145ad7

Browse files
bkaminsnalimilan
andcommitted
Apply suggestions from code review
Co-authored-by: Milan Bouchet-Valat <[email protected]>
1 parent cf62a94 commit 1145ad7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/src/man/working_with_dataframes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,8 @@ julia> combine(df, All() .=> [sum prod]) # the same using 2-dimensional broadcas
837837
If you would prefer the result to have the same number of rows as the source
838838
data frame, use `select` instead of `combine`.
839839

840-
In the remainder of this section we will discuss some of the more advanced topis
841-
related to operation specification syntax, so you may decide to skip them if you
840+
In the remainder of this section we will discuss more advanced topics related
841+
to the operation specification syntax, so you may decide to skip them if you
842842
want to focus on the most common usage patterns.
843843

844844
A `DataFrame` can store values of any type as its columns, for example
@@ -855,7 +855,7 @@ julia> df2 = combine(df, All() .=> extrema)
855855

856856
Later you might want to expand the tuples into separate columns storing the computed
857857
minima and maxima. This can be achieved by passing multiple columns for the output.
858-
Here is an example how this can be done by writing the column names by-hand for a single
858+
Here is an example of how this can be done by writing the column names by-hand for a single
859859
input column:
860860

861861
```
@@ -880,7 +880,7 @@ julia> combine(df2, All() .=> identity .=> [["A_min", "A_max"], ["B_min", "B_max
880880

881881
This approach works, but can be improved. Instead of writing all the column names
882882
manually we can instead use a function as a way to specify target column names
883-
conditional on source column names:
883+
based on source column names:
884884

885885
```
886886
julia> combine(df2, All() .=> identity .=> c -> first(c) .* ["_min", "_max"])
@@ -909,7 +909,7 @@ julia> combine(df, All() .=> Ref∘extrema .=> c -> c .* ["_min", "_max"])
909909

910910
Note that in this case we needed to add a `Ref` call in the `Ref∘extrema` operation specification.
911911
Without `Ref`, `combine` iterates the contents of the value returned by the operation specification function,
912-
which in our case is a tuple of numbers, and tries to expand it assuming that each produced value specifies one row,
912+
which in our case is a tuple of numbers, and tries to expand it assuming that each produced value represents one row,
913913
so one gets an error:
914914

915915
```

0 commit comments

Comments
 (0)