Message Boards Message Boards

[✓] Export weather data from Mathematica to Excel?

GROUPS:

Below please find out the piece of the code used to export weather data from Mathematica to Excel. When I used it on the Mac it never converts it to Excel spreadsheet. Where is the mistake please?

mydataMinTempKTaMia = WeatherData["KTMB", "MinTemperature", {{2005, 1, 1}, {2012, 12, 31}, "Day"}]
Export["/Users/davidquesada/Documents/Research-SRI-Projects/SRI2017/MinTempKTaMia.xlsx", mydataMinTempKTaMia, "XLSX"]

I tried with "xls" also and it said invalid format, cause I changed into "xlsx"

POSTED BY: David Quesada
Answer
4 months ago
mydataMinTempKTaMia = 
 WeatherData["KTMB", 
  "MinTemperature", {{2005, 1, 1}, {2012, 12, 31}, "Day"}] 
Export["MinTempKTaMia.xlsx", mydataMinTempKTaMia // Values, "XLSX"]

This will get the values out of the timeseries object and get them in 1 column in XLS. Is that what you needed?

POSTED BY: l van Veen
Answer
4 months ago

I wish to have it in two columns, one for the date and the second for the value of the Min Temp. Something like: Date MinTemp Jan-01-2005 45

POSTED BY: David Quesada
Answer
4 months ago

In Mathematica Stack Exchange they provided an example very similar to the one I included above, however I did not get the tabular format. I tried also to transform it into a "csv" format, and an error message also popped up. I tried the suggested code and it did not return any reasonable value, if you plot the time series you will see that the values are completely different from the one the conversion provides.

POSTED BY: David Quesada
Answer
4 months ago
Export["MinTempKTaMia.xlsx", mydataMinTempKTaMia // Normal, "XLSX"]

Then use // Normal to get all data out of the object.

POSTED BY: l van Veen
Answer
4 months ago

will try, thank you for your time

POSTED BY: David Quesada
Answer
4 months ago

worked, thank you so much!!!

POSTED BY: David Quesada
Answer
4 months ago

Group Abstract Group Abstract