Question: Using PYTHON, I need to convert my timeList in seconds to h,m,s. What code do I need to convert correctly using my code listed? My

Using PYTHON, I need to convert my timeList in seconds to h,m,s. What code do I need to convert correctly using my code listed?

My code is as follows:

import statistics

def parse(): a=input("Please enter a data center letter: ") a=a.lower() dc="dc="+a numList=[] timeList=[] file=open("data.Data.txt","r") lines=file.readlines() file.close() for line in lines: wordList=line.lower().split() number=wordList[2] time=wordList[1] if (dc in wordList): numList.append(number) timeList.append(time) #print("DC=A",wordList) numList=[float(i) for i in numList] avg=statistics.mean(numList) #numList.sort() #print (timeList) #print (numList) res2=statistics.median(numList) outliers=outlier(numList,timeList,avg) print("Average= ",avg) print ("Median= ", res2) '''print (outliers)''' return

def mean(aList): return float(sum(aList)) / max(len(aList), 1) def outlier(numList,timeList,avg): outliers={} for each in numList: t=timeList[numList.index(each)] if (each avg*3): outliers[t]= each print("OUTLIER(+): " ,t, "|",each) return outliers

Data.txt location https://drive.google.com/open?id=0B-rrZhXoU7AaZEd3Ymw1SWY5S3M

Using PYTHON, I need to convert my timeList in seconds to h,m,s.

import statistics def parse() input ("Please enter a data center letter a a lower dc. num List time List file open data do txt "r") file close for line lines line lower split number wordList [2] time wordList. [1] if (dc in word List) numList. append (number) time List. append (time) print ("DC-A Word List) num List [float (i) for i in numList] avg statistics mean (numList) #numList. Sort print (time List) print (numList) res2 statistics. median (numList) outliers outlier (numList, timeList, avg) print "Average avg) print ("Median res2) print (outliers) T 1 1 return def mean (aList) return float (sum (aList) max (len (aList), 1) def outlier (numList, timeList, avg) outliers for each in numList t time List [numL ist. index (each) if (each avg/3) outliers [t] each print ("OUTLIER ,t, l each) figure this out' if (each avg*3) outliers [t] each print ("OUT LIER t, l n,e each) return outliers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!