using Random
people = ["IIMOG", "YYMOG", "PPMOG","!!WO6" ];
shuffle(people)
4-element Vector{String}: "IIMOG" "!!WO6" "PPMOG" "YYMOG"
using CSV, DataFrames, DataFramesMeta
ENV["COLUMNS"] = 350;
data = DataFrame(CSV.File("annual_weather_data_germany.tsv", missingstring="NA"))
296,119 rows × 9 columns
station_id | year | temperature | sunshine | precipitation | station_name | lat | long | altitude | |
---|---|---|---|---|---|---|---|---|---|
Int64 | Int64 | Float64? | Float64? | Float64? | String | Float64 | Float64 | Int64 | |
1 | 1 | 1931 | 7.52 | missing | 799.3 | Aach | 47.8413 | 8.8493 | 478 |
2 | 1 | 1932 | 8.12 | missing | 640.4 | Aach | 47.8413 | 8.8493 | 478 |
3 | 1 | 1933 | 7.68 | missing | 750.1 | Aach | 47.8413 | 8.8493 | 478 |
4 | 1 | 1934 | 9.31 | missing | 638.8 | Aach | 47.8413 | 8.8493 | 478 |
5 | 1 | 1935 | 8.41 | missing | 824.7 | Aach | 47.8413 | 8.8493 | 478 |
6 | 1 | 1936 | 8.59 | missing | 891.5 | Aach | 47.8413 | 8.8493 | 478 |
7 | 1 | 1937 | 8.59 | missing | 817.4 | Aach | 47.8413 | 8.8493 | 478 |
8 | 1 | 1938 | 8.18 | missing | 766.5 | Aach | 47.8413 | 8.8493 | 478 |
9 | 1 | 1939 | 7.99 | missing | 1072.3 | Aach | 47.8413 | 8.8493 | 478 |
10 | 1 | 1940 | 7.07 | missing | 966.2 | Aach | 47.8413 | 8.8493 | 478 |
11 | 1 | 1941 | 7.61 | missing | 636.0 | Aach | 47.8413 | 8.8493 | 478 |
12 | 1 | 1942 | 7.95 | missing | 734.3 | Aach | 47.8413 | 8.8493 | 478 |
13 | 1 | 1943 | 9.57 | missing | 487.8 | Aach | 47.8413 | 8.8493 | 478 |
14 | 1 | 1944 | 8.22 | missing | missing | Aach | 47.8413 | 8.8493 | 478 |
15 | 1 | 1947 | 9.38 | missing | 520.6 | Aach | 47.8413 | 8.8493 | 478 |
16 | 1 | 1948 | 8.82 | missing | 613.0 | Aach | 47.8413 | 8.8493 | 478 |
17 | 1 | 1949 | 9.27 | missing | 505.0 | Aach | 47.8413 | 8.8493 | 478 |
18 | 1 | 1950 | 8.8 | missing | 774.9 | Aach | 47.8413 | 8.8493 | 478 |
19 | 1 | 1951 | 8.74 | missing | 688.3 | Aach | 47.8413 | 8.8493 | 478 |
20 | 1 | 1952 | 8.33 | missing | 927.7 | Aach | 47.8413 | 8.8493 | 478 |
21 | 1 | 1953 | 8.19 | missing | 606.8 | Aach | 47.8413 | 8.8493 | 478 |
22 | 1 | 1954 | 7.49 | missing | 876.6 | Aach | 47.8413 | 8.8493 | 478 |
23 | 1 | 1955 | 7.87 | missing | 800.1 | Aach | 47.8413 | 8.8493 | 478 |
24 | 1 | 1956 | 7.27 | missing | 675.1 | Aach | 47.8413 | 8.8493 | 478 |
25 | 1 | 1957 | 8.56 | missing | 670.0 | Aach | 47.8413 | 8.8493 | 478 |
26 | 1 | 1958 | 8.55 | missing | 855.0 | Aach | 47.8413 | 8.8493 | 478 |
27 | 1 | 1959 | 8.86 | missing | 704.0 | Aach | 47.8413 | 8.8493 | 478 |
28 | 1 | 1960 | 8.25 | missing | 913.2 | Aach | 47.8413 | 8.8493 | 478 |
29 | 1 | 1961 | 9.12 | missing | 693.1 | Aach | 47.8413 | 8.8493 | 478 |
30 | 1 | 1962 | 7.22 | missing | 629.7 | Aach | 47.8413 | 8.8493 | 478 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
data2021 = @subset(data, :year .== 2021, :temperature .!== missing)
472 rows × 9 columns
station_id | year | temperature | sunshine | precipitation | station_name | lat | long | altitude | |
---|---|---|---|---|---|---|---|---|---|
Int64 | Int64 | Float64? | Float64? | Float64? | String | Float64 | Float64 | Int64 | |
1 | 1001 | 2021 | 9.64 | missing | 603.9 | Doberlug-Kirchhain | 51.6451 | 13.5747 | 97 |
2 | 102 | 2021 | 10.06 | missing | missing | Leuchtturm Alte Weser | 53.8633 | 8.1275 | 32 |
3 | 1048 | 2021 | 9.53 | 4.54 | 735.3 | Dresden-Klotzsche | 51.128 | 13.7543 | 227 |
4 | 1050 | 2021 | 10.15 | 4.27 | 714.7 | Dresden-Hosterwitz | 51.0221 | 13.847 | 112 |
5 | 1051 | 2021 | 10.12 | missing | 661.9 | Dresden-Strehlen | 51.0248 | 13.775 | 120 |
6 | 1052 | 2021 | 9.77 | missing | 724.4 | Drewitz bei Burg | 52.2174 | 12.1641 | 80 |
7 | 1072 | 2021 | 10.85 | missing | 642.8 | Dürkheim, Bad | 49.4719 | 8.1929 | 107 |
8 | 1078 | 2021 | 10.78 | 4.25 | 879.0 | Düsseldorf | 51.296 | 6.7686 | 37 |
9 | 1103 | 2021 | 8.62 | missing | 1073.2 | Ebersberg-Halbing | 48.1003 | 11.9872 | 592 |
10 | 1107 | 2021 | 8.42 | missing | 920.3 | Ebrach | 49.852 | 10.4991 | 346 |
11 | 1161 | 2021 | 8.37 | missing | missing | Eichstätt-Landershofen | 48.8777 | 11.2349 | 384 |
12 | 1197 | 2021 | 8.62 | 4.81 | 896.6 | Ellwangen-Rindelbach | 48.9895 | 10.1312 | 460 |
13 | 1200 | 2021 | 9.61 | missing | missing | Elpersbüttel | 54.0691 | 9.0105 | 3 |
14 | 1207 | 2021 | 7.11 | missing | missing | Elster, Bad-Sohl | 50.2705 | 12.2742 | 558 |
15 | 1214 | 2021 | 9.47 | 4.57 | 1374.7 | Elzach-Fisnacht | 48.2012 | 8.1088 | 431 |
16 | 1224 | 2021 | 10.23 | missing | 806.9 | Emmendingen-Mundingen | 48.1378 | 7.8351 | 201 |
17 | 1246 | 2021 | 10.16 | 4.27 | 613.5 | Ennigerloh-Ostenfelde | 51.8418 | 8.0607 | 104 |
18 | 125 | 2021 | 7.52 | missing | missing | Altenstadt | 47.8342 | 10.8667 | 756 |
19 | 1262 | 2021 | 8.62 | 5.38 | 896.4 | München-Flughafen | 48.3477 | 11.8134 | 446 |
20 | 1266 | 2021 | 9.53 | missing | 885.9 | Erfde | 54.2992 | 9.3162 | 18 |
21 | 1270 | 2021 | 8.82 | 4.3 | 613.1 | Erfurt-Weimar | 50.9829 | 10.9608 | 316 |
22 | 1279 | 2021 | 9.48 | 4.73 | 677.0 | Möhrendorf-Kleinseebach | 49.6497 | 11.0074 | 268 |
23 | 1297 | 2021 | 9.31 | 4.01 | 570.2 | Eschwege | 51.2041 | 10.0138 | 156 |
24 | 1300 | 2021 | 8.14 | missing | 1012.2 | Eslohe | 51.254 | 8.1565 | 351 |
25 | 1303 | 2021 | 10.42 | 4.36 | 1087.3 | Essen-Bredeney | 51.4041 | 6.9677 | 150 |
26 | 131 | 2021 | 8.91 | 4.41 | 896.0 | Geringswalde-Altgeringswalde | 51.0881 | 12.9326 | 296 |
27 | 1327 | 2021 | 10.37 | 4.59 | 753.8 | Weilerswist-Lommersum | 50.7119 | 6.7905 | 147 |
28 | 1332 | 2021 | 8.98 | missing | 816.7 | Falkenberg,Kr.Rottal-Inn | 48.4832 | 12.7241 | 471 |
29 | 1339 | 2021 | 9.1 | missing | missing | Faßberg | 52.9157 | 10.1885 | 73 |
30 | 1357 | 2021 | 6.83 | missing | 944.3 | Fichtelberg/Oberfranken-Hüttstadl | 49.9807 | 11.8376 | 654 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
data2021.temperature = Float64.(data2021.temperature);
using Statistics, CairoMakie
fig = Figure()
ax1 = Axis3(fig[1,1])
scat = scatter!(ax1,data2021.long,data2021.lat,data2021.altitude,color=data2021.temperature,colormap = :hot )
display(fig)
fig = Figure()
ax1 = Axis3(fig[1,1])
scat = scatter!(ax1,data2021.long,data2021.lat,data2021.altitude,color=log.(data2021.temperature.+abs(minimum(data2021.temperature)).+1.0),colormap = :jet )
display(fig)
@combine(data, :avg_temp = mean(skipmissing(:temperature)))
1 rows × 1 columns
avg_temp | |
---|---|
Float64 | |
1 | 8.50186 |
missing
, NaN
, Inf
& co.¶missing === missing
true
missing == missing
missing
NaN == missing
missing
typeof(NaN)
Float64
0/0, Inf/Inf, 0/Inf, Inf/0
(NaN, NaN, 0.0, Inf)
0/0 == missing
missing
typeof(0/0)
Float64
0/0/-Inf
NaN
0/(0/-Inf)
NaN
-0 === 0
true
(1/-Inf) === (1/Inf)
false
0/(-exp(1000)) === 0/exp(1000)
false