Skip to content

Instantly share code, notes, and snippets.

@ikbear
Created November 21, 2011 19:50
Show Gist options
  • Save ikbear/1383716 to your computer and use it in GitHub Desktop.
Save ikbear/1383716 to your computer and use it in GitHub Desktop.
Program for analysis of the data
#!/usr/bin/env python
# encoding: utf-8
import sys
def main():
f = open('data.txt')
c1, c2, c3 = 0.0, 0.0, 0.0
lines = f.readlines()
length = len(lines)
for line in lines:
c1 += float(line.split()[0])
c2 += float(line.split()[1])
c3 += float(line.split()[2])
f.close()
print "Acceptance Rate: "+ str(c3/length) + "%"
print "Rejecting Rate: " + str(c1/length) + "%"
print "Dropping Rate: " + str(c2/length) + "%"
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment