I am trying to read a CSV file with two columns (Date, Float64
) using TextParse
. Unfortunately missing values are coded as “-” in that file. When TextParse
encounters one of those “-” one gets the following error message:
MethodError: Cannot `convert` an object of type Float64 to an object of type TextParse.StrRange
This may have arisen from a call to the constructor TextParse.StrRange(...),
since type constructors fall back to convert methods.
ERROR: LoadError: CSV parsing error at line 1539 char 12:
2012-05-01,-
___________^
column 2 is expected to be: TextParse.Field{Float64,TextParse.Numeric{Float64}}(<Float64>, true, true, true)
I have been unable to add “-” to the set of strings that are to be considered NA
by TextParse
. Which would be the best approach to solve this problem?
Thank you for your help!