Answered You can hire a professional tutor to get the answer.

QUESTION

Some one help for me where something is may be not correct and not running I don't understand which one is Part 1 and part 2. I would expect any

Some one help for me where something is may be not correct and not running I don't understand which one is Part 1 and part 2. I would expect any python code expert check my code and please do the correction. Below the code:

Need to make python program:

(http://www.weather.gov/rah/rdutemperaturerecords)

Part # 1: Need to go above this website and find the daily record report. Paste / cut the entire report into a file. Never modify the file from this point on. Then write python program which reads the file and finds the lowest recorded time in Raleigh day and year. The program should read and process the data file only one line at a time and do NOT store data in memory. Big data analysis is simulated.

Hint: Need to look over at the data file and select a strategy to get rid of unnecessary data and scan what 's left to find the lowest temperature. Then write down the steps and ensure that someone read the file only once. When someone have a strategy, make the program incrementally using print statements liberally. After this program is done, scan the original file by hand to verify that the program found the correct temp and date.

Part # 2: Then modify this program to find the highest recorded temp.  In this case there are three days that tie for the highest temp. And modify this program so it would be:

1) Find both the highest and lowest recorded temperatures

2) Report each month/day/year when these temps were reached

3) Make no assumptions about how many days will tie for the highest temp or lowest temp.

Have to remember that, the program must process the data line by line, only one time.   

And think about how this will happen before someone start typing!

file = open("input190.txt","r")

list = []

max = 0.0

min = 10000.0

for line in file:

  list1 = line.split(" ") # Assuming data in file as m/day/year temp

list.append(list1)

if float(list1[1]) > max:

  max = float(list1[1])

if float(list1[1]) < min:

  min = float(list1[1])

file.close()

print("Highest temperature:",max)

print("Lowest temperature:",min)

print("Maximum Temperature recorded on")

for i in range(len(list)):

  if float(list[i][1]) == max:

    print(list[1][0])

print("Minimum Temperature recorded on")

for i in range(len(list)):

  if float(list[i][1]) == min:

    print(list[1][0])

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question