Investigating the contents of a data frame
Understanding how to check the contents of DataFrame
after creating it is an essential aspect of working with data. In this recipe, we explain what features of the DataFrames.jl
package make this task easy.
Getting ready
Make sure that you have the DataFrames.jl
package installed. If it is missing, 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...
Here is a list of steps to be followed:
- Create a random
DataFrame
so that its contents can be inspected later:
julia> using DataFrames, Random julia> Random.seed!(1); julia> df = DataFrame(rand(1000, 100));
- Confirm the
DataFrame
that was created is too large to be displayed, as it contains1000
rows and100
columns by using thenrow
,...