using Pkg
Pkg.activate(@__DIR__);
Pkg.instantiate()
using StatsPlots
using CSV, DataFrames
import Dates: DateTime
Activating project at `c:\Users\ayats\Documents\ici-parsing`
The WebIO Jupyter extension was not detected. See the WebIO Jupyter integration documentation for more information.
data = CSV.File(
open("data/Grazalema_AEMET_2021-2022.csv");
normalizenames=true,
select=[:ts, :value],
types=Dict(:ts => DateTime),
dateformat="yyyy-mm-dd HH:MM:SS.s"
) |> DataFrame
data = data[1:24*5, :]
Row | value | ts |
---|---|---|
Float64 | DateTime | |
1 | 5.4 | 2021-01-01T01:00:00 |
2 | 4.2 | 2021-01-01T02:00:00 |
3 | 4.1 | 2021-01-01T03:00:00 |
4 | 4.1 | 2021-01-01T04:00:00 |
5 | 3.8 | 2021-01-01T05:00:00 |
6 | 3.3 | 2021-01-01T06:00:00 |
7 | 2.7 | 2021-01-01T07:00:00 |
8 | 2.9 | 2021-01-01T08:00:00 |
9 | 3.6 | 2021-01-01T09:00:00 |
10 | 4.2 | 2021-01-01T10:00:00 |
11 | 4.8 | 2021-01-01T11:00:00 |
12 | 5.5 | 2021-01-01T12:00:00 |
13 | 6.5 | 2021-01-01T13:00:00 |
⋮ | ⋮ | ⋮ |
109 | 7.3 | 2021-01-05T13:00:00 |
110 | 6.6 | 2021-01-05T14:00:00 |
111 | 6.9 | 2021-01-05T15:00:00 |
112 | 6.1 | 2021-01-05T16:00:00 |
113 | 5.6 | 2021-01-05T17:00:00 |
114 | 5.1 | 2021-01-05T18:00:00 |
115 | 4.7 | 2021-01-05T19:00:00 |
116 | 3.9 | 2021-01-05T20:00:00 |
117 | 2.9 | 2021-01-05T21:00:00 |
118 | 1.5 | 2021-01-05T22:00:00 |
119 | 2.3 | 2021-01-05T23:00:00 |
120 | 2.3 | 2021-01-06T00:00:00 |
@df data plot(:ts, :value,
label="Measured",
marker=:circle,
markersize=2,
)
macro plot_common()
return quote
(-5, 15) |> ylims!
"Date" |> xlabel!
"Temperature" |> ylabel!
end
end
@plot_common()
# import SingularSpectrumAnalysis as SSA
# data_trend, data_season = SSA.analyze(
# data[:, :value],
# 20,
# )
# plot(data[:, :ts], data_trend, lab="Trend")
# plot!(data[:, :ts], data_season, lab="Seasonality")
# @lims()