Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv as csv
- import numpy as np
- csv_file_object = csv.reader(open('test.csv', 'rb'))
- header = csv_file_object.next()
- data=[]
- for row in csv_file_object:
- data.append(row)
- data = np.array(data)
- hr = data[0::,0].astype(np.float)
- mime = data[0::,1].astype(np.float)
- age = float(input("Enter your age (in years): "))
- if age > 19 and age < 31:
- i = 0
- for row in hr:
- if mime.all() > 0.4 and hr.all() > 100:
- hr = hr + i
- avghr = hr / len(hr)
- print avghr
- else:
- print ('Age not in range')
- Enter your age (in years): 25
- [ 7.14285714 7.21428571 7.28571429 7.35714286 7.42857143 7.5
- 6.42857143 5.17357143 5.21428571 7.85714286 8.57142857 9.28571429
- 5.15642857 5.19142857]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement