I’m trying to convert a column of type “Any” in my dataframe to a column of type “Float64”. It seems that there are float values and string values in the column.
Which yielded the following error:
ERROR: LoadError: MethodError: no method matching tryparse(::Type{Float64}, ::Float64)
I then tried computing my correlation:
my_correlation = cor(df.column1, df.column2)
Which yielded the following error:
ERROR: LoadError: MethodError: no method matching /(::String31, ::Int64)
It seems when I use tryparse() I run into a Float64 value and get an error. When I don’t try to convert the strings and just run my correlation, I end up getting an error because you cannot calculate a Pearson correlation with strings. Is there a better way to go about parsing the strings?