From 80fa7033e12b896f314757ccd2067268d08dd2d5 Mon Sep 17 00:00:00 2001 From: Jon Whiteaker Date: Wed, 22 Feb 2012 17:03:09 -0800 Subject: added height --- data/combined/height.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 data/combined/height.py (limited to 'data/combined/height.py') diff --git a/data/combined/height.py b/data/combined/height.py new file mode 100755 index 0000000..5a8dd02 --- /dev/null +++ b/data/combined/height.py @@ -0,0 +1,22 @@ +#!/usr/bin/python + +import sys + +sk_file = open(sys.argv[1]) +labels = sk_file.readline().strip().split(',') +end = labels.index('h-sc') +print(','.join(labels[0:end] + ["height"])) +for line in sk_file: + line = line.strip().split(',') + out = line[0:end] + height = 0.0 + for limb in map(lambda x: float(line[labels.index(x)]), ['h-sc','sc-s','s-hc','hi-kn','kn-an']): + if limb > 0: + height += limb + else: + height = -1 + break + out += [str(height)] + print(','.join(out)) + + -- cgit v1.2.3-70-g09d2