November 2017
Beginner
316 pages
6h 40m
English
Suppose, for example, we have a dataset with floating-point numbers:
julia> x = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6]
This will create a six-element array {Float64,1}.
Now, suppose this dataset has a missing value at position [1]. That means instead of 1.1, there is no value. This cannot be represented by the array type in Julia. When we try to assign an NA value, we get this error:
julia> x[1] = NAError: UndefVarError: NA not definedwhile loading In[2], in expression starting on line 1
Therefore, right now, we cannot add NA values to the array that we have created.
So, to load the data into an array that does have NA values, we use DataArray. This enables us to have NA values in our dataset:
julia> using DataArrays ...
Read now
Unlock full access