Description
Using the environmental data for each of the provinces in Canada, and weighting each piece of data by the number of cities in the province, calculate the mean temperature, mean high temperature, mean low temperature, and mean precipitation for all of CanadaIn each case, write a program using your choice of Spark or Hadoop (map/reduce) and the language of your choice. It would make sense to treat the data as manipulation of matrices. Do not assume that the input data is all on the same node.
If Spark, your submission should include the Spark program, and the answers (probably in a matrix of the same form as the input matrices.If Hadoop, our submission should be copied into MSWord, and should include (in one file):Your “mapper” programThe K/V value pairs emitted by your mapperYour “reducer” programThe K/V pairs emitted by your reducerThe Answers
1 attachmentsSlide 1 of 1attachment_1attachment_1
Unformatted Attachment Preview
Alberta
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
36,8
48,3
25,8
18,2
10,6
21,2
0,9
0,9
FEB
MAR
British Columbia
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
43,7
52,2
35,2
49
27,2
32,9
21,5
7,1
Manitoba
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
34,6
44,6
24,5
20,4
New Brunswick
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
40,5
50,1
31,2
44,4
Newfoundland
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
37,9
45,5
30,9
49,2
Northwest Territories
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
FEB
MAR
APR
MAY
18,2
-14,9
-12,5
-5
13,4
31,8
25,5
-7,8
-4,6
4,3
22,7
40,2
10,7
-22,2
-20,8
-14,5
4
23,6
10
0,6
0,5
0,4
0,4
0,6
Nova Scotia
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
43,3
51,5
35,1
53,5
Nunavut
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
FEB
MAR
APR
9,5
-20,5
-21,2
-15,4
15,5
-14,1
-14,6
-8,4
3,7
-27,1
-27,8
-22,5
9,3
0,4
0,3
0,4
15,8
27
5
0,7
FEB
MAR
30,5
37,6
23,4
4,3
FEB
-0,3
9,2
-9,7
0,9
FEB
FEB
22,6
30,5
14,7
5,2
49,7
61,6
37,9
2,2
MAY
37,8
46,9
29,1
3,4
APR
24
31,8
16,8
3,8
MAR
22,9
31
14,7
4,2
MAY
APR
MAR
50,9
61,3
40,6
2,8
36,2
47,1
25,3
1,1
26,2
35,4
17
3,6
17,4
25,7
9,9
3,9
MAY
APR
MAR
49,5
62,1
36,9
2
43,8
53,5
34,1
3,3
18,5
28,5
8,6
1
16,5
26,6
6,6
3
18
25,8
11
4,5
APR
MAR
FEB
MAY
39,1
51,2
27,4
1,1
36,7
45,1
28,2
4
5,9
15,9
-4
0,7
14
23,6
4,7
4
APR
25,3
36,2
14,5
0,9
49,8
60,6
39,1
3,8
MAY
33,4
40,5
27
3,5
APR
29,6
37,1
22
4,7
42,2
50,4
34,5
3,5
MAY
38,8
46,6
31,3
4,3
48,5
57,7
39,3
4,1
MAY
-0,7
6,7
-8
0,5
18
24
12,1
0,7
Ontario
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
41,4
50,7
32,3
35,2
FEB
Prince Edward Island
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
42,3
49,9
34,6
45,4
Quebec
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
37,5
46,8
28,3
40,3
7,5
17,3
-2
2,8
Saskatchewan
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
36
46,6
25,3
16,5
4,4
13,9
-5
0,7
Yukon
Average Temperature (F)
Average High Temperature (F)
Average Low Temperature (F)
Average Precipitation (in)
ANNUAL JAN
FEB
MAR
APR
MAY
22,5
-7,6
-0,2
10,7
27,3
36,9
31,6
1,6
10,7
23,6
39,1
47,4
13,1
-16,8
-11,1
-2
15,2
26,8
12,9
0,8
0,6
0,5
0,4
0,9
14
22,6
5,4
2,6
MAR
16,8
26,1
7,6
2,1
FEB
18,4
26,2
10,6
4,1
APR
26,4
35,8
16,9
2,3
MAR
19,1
27,1
11,1
3,2
FEB
APR
MAR
FEB
37,2
44,3
30,1
3,4
21,8
31,7
12,1
2,6
48,4
57,2
39,5
3,7
MAY
36,5
45,7
27,3
2,8
APR
21,9
31,9
12
0,8
52,3
63,2
41,5
3,1
MAY
APR
MAR
9,9
19,7
0,2
0,5
40,3
50,1
30,6
2,6
27
34
19,9
3,4
11
21,3
0,9
2,3
MAY
49,2
59,8
38,7
3,5
MAY
38,5
50,2
27
0,9
50,9
63,3
38,2
1,9
JUN
JUL
56,7
68,8
44,7
3,2
JUN
AUG
60,9
73,6
48,5
3
JUL
56,8
67,1
46,5
2,8
JUN
AUG
61,2
72,2
50,1
2,2
JUL
59,6
70,7
48,5
3,3
JUN
JUN
JUL
JUN
AUG
JUL
47,4
56,1
38,6
1
JUN
AUG
53,5
62,2
45
1,4
JUL
57,3
66,9
47,8
3,8
JUN
AUG
OCT
SEP
OCT
SEP
41
46,5
35,6
1,5
DEC
NOV
DEC
NOV
16,3
21,2
11,4
1,1
# CITIES
24
25
25
25
83
81
81
77
26
25
25
24
# CITIES
132
127
127
136
# CITIES
26
24
24
25
YEARS
28,9
35,6
21,9
5,4
DEC
-1,5
4,4
-7,6
0,7
25
23
24
24
# CITIES
144
140
140
181
YEARS
-8,7
-1
-15,8
0,5
38,9
45,5
32,3
5,5
# CITIES
471
469
469
517
YEARS
24,5
31
18,6
4,5
1,8
8
-4,5
0,8
47,8
55,7
39,9
4,8
OCT
30,9
34,9
27,1
1,3
DEC
NOV
24
24
24
25
YEARS
21
29,3
13,1
3,9
33,9
39,9
28,5
4,5
23
28,2
17,6
1,1
57,3
66,1
48,7
4,3
DEC
NOV
# CITIES
245
236
236
277
YEARS
5,6
14,1
-2,8
1
33,7
40,8
26,8
4,2
42,9
49,5
36,6
4,7
39,1
45,3
32,9
1,2
64,1
73,1
55,1
3,7
AUG
43,9
50,5
37,3
1,3
OCT
SEP
DEC
NOV
24
25
25
24
YEARS
27,5
32,8
22,3
6,2
20,7
28,3
13,1
1,1
44,6
53,5
35,9
3,9
52,1
60
44,8
4,5
49,8
57,8
42,1
1,6
64
73,1
54,8
3,6
JUL
34,6
39,9
29,7
0,7
SEP
DEC
NOV
OCT
YEARS
13,8
23,8
4,4
0,8
34
39,4
28,5
6,9
39,1
48,1
30
1,5
55,4
65,5
45,5
3,6
58,9
67,2
51,2
4
NOV
OCT
SEP
DEC
23,3
32,6
14,1
0,9
44,3
52
36,7
5,3
52,1
62,6
41,4
2,1
63,7
74,2
53,3
3,6
58,1
66,8
50
3,9
OCT
SEP
AUG
NOV
39,2
50,6
28,2
0,9
54
64,3
43,7
2,9
62,9
74,4
51,3
2,7
64,9
75,4
54,5
3,8
50,2
59,1
41,9
3,9
SEP
AUG
JUL
OCT
50
62,5
37,7
1,7
60,8
72
49,5
2,2
64,7
75,8
53,5
3
59,2
70,1
48,4
3,6
SEP
59,2
72,3
46,4
2,3
# CITIES
29
27
27
28
YEARS
-12,9
-2,8
-19,2
0,4
42
42
42
41
85
83
83
90
# CITIES
24
23
23
24
63
63
63
63
JUN
JUL
61,7
72,4
51
3,2
JUN
AUG
66,8
77,4
56,2
3,2
JUL
58,2
67,1
49,3
3,5
JUN
AUG
JUL
JUN
DEC
DEC
4,6
11,9
-2,4
0,9
21
21
21
20
19
19
19
20
27
26
26
26
# CITIES
411
407
407
414
27
27
27
27
# CITIES
214
215
214
243
YEARS
8,6
17,7
-0,3
0,8
YEARS
-3,1
5,2
-11,1
0,9
# CITIES
337
329
329
375
# CITIES
YEARS
15,2
23,5
7,1
3,2
21,5
29,7
13
0,7
NOV
23,5
30,3
16,6
1,1
YEARS
DEC
NOV
27
26
26
28
26,3
32,7
19,9
4,5
30
36,6
23,2
3,5
39,1
49,7
28,5
1
OCT
37,2
46,1
28,5
1,4
DEC
NOV
OCT
YEARS
20,7
27,9
13,3
2,9
37,3
43
31,6
4,5
42
50
34,1
3,7
51,8
63,7
39,7
1,6
SEP
46,6
56,9
36,1
1,7
NOV
OCT
SEP
DEC
33,1
39,8
26,5
3,3
47,3
54,1
40,4
4,3
53,4
62,7
44,1
3,9
62,7
75,5
49,7
2
AUG
50,5
61,1
39,8
2,1
OCT
SEP
AUG
NOV
45,2
53,5
37
3,1
57,7
65,5
49,9
4
61,9
71,9
51,9
4,1
64,3
76,7
51,9
2,7
JUL
46,7
57,7
35,8
1,5
SEP
AUG
JUL
OCT
56,7
66,2
47,2
3,6
65,3
73,6
57
3,5
63,8
74,1
53,6
4,2
59,5
71,4
47,5
2,8
JUN
64,9
75,1
54,6
3,3
65,6
74,1
57,1
3,2
58,7
69,3
48,2
3,9
SEP
# CITIES
23
23
23
25
41
41
41
41
Purchase answer to see full
attachment
Explanation & Answer:
code
Tags:
program
Hadoop
Spark
User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.