Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python Program- Write a python program for Map and Reduce to find minimum temperature. Please help I have been given python code to find maximum
Python Program-
Write a python program for Map and Reduce to find minimum temperature. Please help
I have been given python code to find maximum temperature for Map and Reduce for reference
Example 2-9. Map function for maximum temperature in Python lusbin/env python import re import sys dinl or line in svs.st val ine strip (year, temp, q) (val[15:19], val[87:92], val[92:93]) (templ "+9999" and re.match("[01459]", q) print "%sues," % (year, temp) Example 2-10. Reduce function for maximum temperature in Python !/usr/bin/env python import sys (last key, maxval) (None, 0) for line in sys.stdin: (key, val)- linestrip().split"It") f last_key and last_key F key: print "%sW2S" % (last-key, max.xal) (last key, max.val)(key, int(val)) else: (last key, maxval)(key, max(max.val, int(val))) if last_key: print "%st%s" % (last-key, maxwal) Example 2-9. Map function for maximum temperature in Python lusbin/env python import re import sys dinl or line in svs.st val ine strip (year, temp, q) (val[15:19], val[87:92], val[92:93]) (templ "+9999" and re.match("[01459]", q) print "%sues," % (year, temp) Example 2-10. Reduce function for maximum temperature in Python !/usr/bin/env python import sys (last key, maxval) (None, 0) for line in sys.stdin: (key, val)- linestrip().split"It") f last_key and last_key F key: print "%sW2S" % (last-key, max.xal) (last key, max.val)(key, int(val)) else: (last key, maxval)(key, max(max.val, int(val))) if last_key: print "%st%s" % (last-key, maxwal)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started