I dropped missing values from a dataframe and then turned a column into a vector. The vector does not have missing values, but it has type:
7554-element Vector{Union{Missing, Float64}}:
This prevents me from using the autocov function. Does anyone know how to convert it to just a vector of only Float64? Filtering missing values again does not drop any observations and it still remains the wrong type:
I think you want disallowmissing or its in-place version disallowmissing!.
julia> using DataFrames
help?> disallowmissing!
search: disallowmissing! disallowmissing
disallowmissing!(df::DataFrame, cols=:; error::Bool=true)
Convert columns cols of data frame df from element type Union{T, Missing} to T to drop support
for missing values.
cols can be any column selector (Symbol, string or integer; :, Cols, All, Between, Not, a
regular expression, or a vector of Symbols, strings or integers).
If cols is omitted all columns in the data frame are converted.
If error=false then columns containing a missing value will be skipped instead of throwing an
error.
Metadata: this function preserves table-level and column-level :note-style metadata.
The end result is the same as some of the ideas above, but I feel like this one does a decent job of communicating (to humans) your intent—to set a new container type rather than operating on elements: