Working with categorical data
In Julia, the type of data often carries important information about how the information stored should be interpreted. However, in some cases, working with categorical data can be tricky. In this recipe, we explain how you can refer to an order defined in a categorical vector to filter its contents.
Getting ready
Start the Julia command line. Make sure that you have the DataFrames.jl
 package installed. If it is missing, then install it by running the commands using Pkg; Pkg.add("DataFrames")
in the Julia command line.
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.
Now, open your favorite terminal to execute the commands.
How to do it...
In this recipe, we create a simple data frame containing categorical data, which we will later filter. Here is a list of steps to be followed:
- Firstly, load the
DataFrames.jl
package and define a vector of possible grades fromF
toA...