Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
converts time string to continuous variable
  • Loading branch information
neilkod committed Mar 28, 2011
1 parent 5b624fd commit fe78cf0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion analyze5k.py
@@ -1,6 +1,10 @@
#!/bin/python
import sys

# purpose of the code is to take the input data and convert the
# duration string into a continuous numerical feature.
# output the duration as minutes and everything else, in tab-separated
# format.

for line in sys.stdin:
data = line.strip()
Expand All @@ -12,4 +16,5 @@
secs = (int(time_components[0]) * 60) + int(time_components[1])
elif len(time_components) == 3:
secs = (int(time_components[0]) * 3600) + (int(time_components[1]) * 60) + int(time_components[2])
print "%s\t%s\t%s\t%s\t%.2f\t%s" % (name.lower(),gender,secs,team.lower(),float(secs)/60,time)
print "\t".join([name.lower(),gender,secs,team.lower(),float(secs)/60,time])

0 comments on commit fe78cf0

Please sign in to comment.