Hi,
I am trying to follow the tutorials on “Julia for Data science” and am getting Unexpected Character error whenever I try to use JSON.parsefile()
. I have tried many different JSON files but, the error still pops up. I found a somewhat similar problem in another thread but author of that had later on developed LazyJSON. I tried that too along with JSON2.jl and JSON3.jl but no success.
Can someone please recommend something regarding this? Code and error are posted below:
using Clustering
using VegaLite
using VegaDatasets
using DataFrames
using Statistics
using JSON
using CSV
using Distances
download("https://raw.githubusercontent.com/ageron/handson-ml/master/datasets/housing/housing.csv","newhouses.csv")
houses= CSV.read("newhouses.csv")
download("https://github.com/JuliaAcademy/DataScience/blob/master/data/california-counties.json","california-counties.json")
cali_shape = JSON.parsefile("california-counties.json")
LoadError: Unexpected character
Line: 5
Around: ... <!DOCTYPE html> <html ...
^
in expression starting at Z:\Julia Tutorials\tutorial_5.jl:15
error(::String) at error.jl:33
_error(::String, ::JSON.Parser.MemoryParserState) at Parser.jl:142
parse_jsconstant(::JSON.Parser.ParserContext{Dict{String,Any},Int64,true,nothing}, ::JSON.Parser.MemoryParserState) at Parser.jl:195
parse_value(::JSON.Parser.ParserContext{Dict{String,Any},Int64,true,nothing}, ::JSON.Parser.MemoryParserState) at Parser.jl:172
parse(::String; dicttype::Type{T} where T, inttype::Type{Int64}, allownan::Bool, null::Nothing) at Parser.jl:463
(::JSON.Parser.var"#parse##kw")(::NamedTuple{(:dicttype, :inttype, :allownan, :null),Tuple{DataType,DataType,Bool,Nothing}}, ::typeof(JSON.Parser.parse), ::String) at Parser.jl:461
#4 at Parser.jl:524 [inlined]
open(::JSON.Parser.var"#4#5"{DataType,DataType,Nothing,Bool,Bool,Int64}, ::String; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at io.jl:298
open at io.jl:296 [inlined]
#parsefile#3 at Parser.jl:522 [inlined]
parsefile(::String) at Parser.jl:521
top-level scope at tutorial_5.jl:15