Travaillez avec les séries temporelles valorisées quantitativement
Analysez la variabilité de la température à un endroit donné.
In[1]:=
![Click for copyable input](assets.fr/working-with-quantity-valued-time-series/In_91.png)
data = WeatherData[
Entity["City", {"Champaign", "Illinois", "UnitedStates"}],
"Temperature", {{2016, 3, 20}, {2016, 3, 22}}];
In[2]:=
![Click for copyable input](assets.fr/working-with-quantity-valued-time-series/In_92.png)
temps = TimeSeries[data, MissingDataMethod -> "Interpolation"]
Out[2]=
![](assets.fr/working-with-quantity-valued-time-series/O_64.png)
Visualisez la série temporelle de la température.
In[3]:=
![Click for copyable input](assets.fr/working-with-quantity-valued-time-series/In_93.png)
DateListPlot[temps, PlotTheme -> "Detailed"]
Out[3]=
![](assets.fr/working-with-quantity-valued-time-series/O_65.png)
Les propriétés de base.
In[4]:=
![Click for copyable input](assets.fr/working-with-quantity-valued-time-series/In_94.png)
stats = {Min, Max, Mean, Median, StandardDeviation};
TableForm[{Map[#[temps] &, stats]}, TableHeadings -> {None, stats}]
Out[4]//TableForm=
![](assets.fr/working-with-quantity-valued-time-series/O_66.png)
Convertissez des températures en degrés Fahrenheit.
In[5]:=
![Click for copyable input](assets.fr/working-with-quantity-valued-time-series/In_95.png)
tempsF = UnitConvert[temps, "DegreesFahrenheit"];
TableForm[{Map[#[tempsF] &, stats]}, TableHeadings -> {None, stats}]
Out[5]//TableForm=
![](assets.fr/working-with-quantity-valued-time-series/O_67.png)
Trouvez la moyenne mobile sur 6 heures.
In[6]:=
![Click for copyable input](assets.fr/working-with-quantity-valued-time-series/In_96.png)
avg = MovingMap[Mean, temps, {Quantity[6, "Hours"], Center}]
Out[6]=
![](assets.fr/working-with-quantity-valued-time-series/O_68.png)
Afficher l'entrée complète de Wolfram Language
Out[7]=
![](assets.fr/working-with-quantity-valued-time-series/O_69.png)