I downloaded air quality monitoring data from open data sites for spatial data analysis and found that the monitoring value type was a string. Is there an easy way to convert a string into a numeric(real or integer)? Besides, monitoring values ??include missing ??and error values. Is there a better way to clean up?
data = Select[#[[3]] != "" &&
ContainsOnly[
ToCharacterCode[#[[3]]], {46, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57}] &]@Values@KeyDrop[#, "PublishTime"] &@
DeleteDuplicates@
Query[All, {"Latitude", "Longitude", "PM2.5", "PublishTime"}]@
Import["https://opendata.epa.gov.tw/ws/Data/AQI/?$format=json",
"RawJSON", CharacterEncoding -> "CP950"];
data = Map[{GeoPosition[ToExpression[{#[[1]], #[[2]]}]], #[[3]]} &,
data];
Head[#] & /@ data[[All, 2]]