I am trying to create a list of the average global temperatures per-year for the last 18 years using the WeatherData
function. You can input a set coordinates followed by "Temperature"
and a date to get the historical data. I am trying to do this for every country in the world. Here is my code:
YearlyGlobalTemp =
WeatherData[#,
"Temperature", {{2000, 1, 1}, {2018, 1, 1}, "Year"}] & /@
CountryData["Countries"];
I should be getting a list of timeseries
plots for my output, but instead I get a list of 240 $Failed
.
YearlyGlobalTemp
is a list of 240TimeSeries
objects, which I can applyDateListPlot
to. What do you get as output? $\endgroup$YearlyGlobalTemp
, I get a list of 240$Failed.
What does your output look like? $\endgroup$TimeSeries
. The first step here is to work with a list of just 2 countries, so you don't have to wait 10 minutes to see that it failed. Also, we can try clearing any cached values you might have. Try evaluatingInternal`ClearEntityValueCache[]; countries = CountryData["Countries"][[;; 3]]; WeatherData[GeoPosition[#], "Temperature", {{2000, 1, 1}, {2018, 1, 1}, "Year"}] & /@ countries
$\endgroup$