How to handle weakrefstrings when importing a CSV file

Great thanks, what you want is:

julia> first.(getindex.(JSON.parse.(data.geometry), "coordinates"))
12-element Array{Float64,1}:
 -3.7361068677412166
 -3.7371190836803483
 -3.736369954703371
 -3.73638333200653
 -3.7366776326760576
 -3.736187131560178
 -3.7353265250568626
 -3.7391256791544
 -3.738871510394354
 -3.7384033047837417
 -3.738430059390062
 -3.735915126395919

julia> last.(getindex.(JSON.parse.(data.geometry), "coordinates"))
12-element Array{Float64,1}:
 58.39179006274112
 58.388378850435224
 58.39074663309461
 58.39090716073254
 58.39040774141455
 58.390809060509355
 58.38924391603958
 58.38983251737866
 58.38889610615743
 58.38941336187963
 58.389694285246
 58.3906619101746

While first and last work in this case, you could generalize this by replacing it with getindex.(getindex.(JSON.parse.(data.geometry), "coordinates"), n) where n is the index you need (i.e. 1 or 2 in your case).

1 Like