# Read a csv file from the current directory
# import the csv function library
import csv

filename = "data.csv"

with open(filename,'r') as csvfile:
    csvData = csv.reader(csvfile,delimiter = ',',quotechar = '"')

    AvgDuration = 0
    AvgPulse = 0
    rowCounter = 0
    for row in csvData:

        if rowCounter != 0:
            AvgDuration = (AvgDuration + float(row[0]) ) /2
            AvgPulse = (AvgPulse + float(row[1]) )/2
#        print(row, AvgDuration, AvgPulse)
        rowCounter = rowCounter + 1

print(f"Average Duration = {AvgDuration:.1f}")
print(f"Average Pulse = {AvgPulse:.0f}")


