diff options
Diffstat (limited to 'data/combined/height.py')
| -rwxr-xr-x | data/combined/height.py | 22 |
1 files changed, 22 insertions, 0 deletions
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)) + + |
