# Wolfram Mathematica

## Data from Internet Sources

Download daily mean temperatures for the past year for the Great Lakes.

In[1]:=
```rawdata = Import["http://coastwatch.glerl.noaa.gov/ftp/glsea/avgtemps/glsea-\ temps_1024.dat", "Data"];```

The observations begin from row 11.

In[2]:=
`rawdata[[;; 11]]`
Out[2]=
In[3]:=
`obs = rawdata[[11 ;;]];`

The number of observations.

In[4]:=
`Length[obs]`
Out[4]=

Define the list of lakes.

In[5]:=
```lakes = {"Superior", "Michigan", "Huron", "Erie", "Ontario", "St. Clair"};```
show complete Wolfram Language input
In[6]:=
```en = {Entity["Lake", "LakeSuperior::52tvr"], Entity["Lake", "LakeMichigan::y3357"], Entity["Lake", "LakeHuron::5t8vh"], Entity["Lake", "LakeErie::6tm6r"], Entity["Lake", "LakeOntario::35gt7"], Entity["Lake", "LakeSaintClair::3r368"]}; markers = Map[Text[Style[ StringReplace[StringTrim[#["Name"], "Lake"], "Saint" -> "St."], Bold, 12, Black, FontFamily -> "Arial"], #["Position"], Right] &, en]; GeoGraphics[{EntityClass["Lake", "GreatLakes"], markers}, GeoCenter -> GeoPosition[{46, -84}], GeoRange -> {{40, 50}, {-93, -74}}, GeoBackground -> GeoStyling["ReliefMap", ColorFunction -> (ColorData["RedBlueTones"][1 - #] &)], ImageSize -> Medium]```
Out[6]=

Create dates to serve as time stamps in the TimeSeries.

In[7]:=
```dates = Table[ DatePlus[{obs[[k, 1]], 1, 1}, Quantity[obs[[k, 2]], "Days"]], {k, 1, Length[obs]}];```

Use QuantityArray to store the temperatures and the unit.

In[8]:=
`values = QuantityArray[obs[[All, 3 ;;]], "DegreesCelsius"]`
Out[8]=

Store the list of the lakes as MetaInformation that can be retrieved later, for example, to create plot legends.

In[9]:=
```ts = TimeSeries[values, {dates}, MetaInformation -> {"Lakes" -> lakes}]```
Out[9]=
In[10]:=
```DateListPlot[ts, PlotLegends -> ts["Lakes"], PlotTheme -> "Detailed", FrameLabel -> Automatic]```
Out[10]=

Study descriptive statistics for each lake.

In[11]:=
```stats = {Min, Max, Mean, Median, StandardDeviation}; summary[lake_] := Map[#[lake] &, stats]```
In[12]:=
```TableForm[ Table[summary[ts["PathComponent", k]], {k, 1, Length[lakes]}], TableHeadings -> {lakes, stats}]```
Out[12]//TableForm=