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 = 
 "Temperature", {{2000, 1, 1}, {2018, 1, 1}, "Year"}] & /@ 

I should be getting a list of timeseries plots for my output, but instead I get a list of 240 $Failed.

  • $\begingroup$ Your code seems to be working for me. After evaluating YearlyGlobalTemp is a list of 240 TimeSeries objects, which I can apply DateListPlot to. What do you get as output? $\endgroup$ – Jason B. Apr 3 '18 at 17:16
  • $\begingroup$ My output of YearlyGlobalTemp, I get a list of 240 $Failed. What does your output look like? $\endgroup$ – hwhorf Apr 3 '18 at 18:49
  • 1
    $\begingroup$ I get a list of 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 evaluating Internal`ClearEntityValueCache[]; countries = CountryData["Countries"][[;; 3]]; WeatherData[GeoPosition[#], "Temperature", {{2000, 1, 1}, {2018, 1, 1}, "Year"}] & /@ countries $\endgroup$ – Jason B. Apr 3 '18 at 19:45
  • 1
    $\begingroup$ @hwhorf Did the comment by JasonB or your own efforts solved your problem? You could post your own answer! $\endgroup$ – rhermans Jul 16 '18 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.