Creating pivot tables by chaining transformations of data frames
Often in data analysis, you have to perform multiple steps on transformations of your data frame. In this recipe, we show how you can conveniently perform those operations using the DataFramesMeta.jl
package, with an example of preparing a pivot table, one of the most basic methods of summarizing data.
Getting ready
Make sure you have the iris.csv
file in your working directory, which was downloaded in the Reading CSV data from the internet recipe. Open the Julia command line and install the DataFrames.jl
, DataFramesMeta.jl
, and CSV.jl
packages if required, using the following commands:
julia> using Pkg julia> Pkg.add("DataFrames") julia> Pkg.add("DataFramesMeta") julia> Pkg.add("CSV")
Note
In the GitHub repository for this recipe, you will find the commands.txt
file, which contains the presented sequence of shell and Julia commands. The iris.csv
file contains the data that we will analyze.
Before we begin, start...