Today we worked from home because Dr. Walker was busy with helping his mom. I spent the entire day working on using the equations we collected for calculating girth and designing a program that would calculate every patient’s girth and input the estimated girth calculation into their file. By the end of the day, I managed to finish the calculations ignoring the person’s ethnicity. Once we add ethnicity to the files, I will go back and edit the calculation to include ethnicity in the code. I tested the program and it appears to work perfectly well, I am excited to see the results when we use it with all of the patient data.
Snippet of code used:
#Returns the number of the specified column, “name”
def getColNum(name):
i = 0
while(name != sheet.cell(0, i).value):
i = i+1
return i
#Returns the row of the specified participant
def getRowNum(ID):
i = 0
while(ID != sheet.cell(i, getColNum(‘Participant ID’)).value):
i = i+1
return i
#Returns BMI of specified participant
def getBMI(ID):
return sheet.cell(getRowNum(ID), getColNum(‘BMI’)).value
#Returns WC of specified participant
def getWC(ID):
return sheet.cell(getRowNum(ID), getColNum(‘Waist (cm)’)).value
#Returns gender of specified participant
def getSex(ID):
return sheet.cell(getRowNum(ID), getColNum(‘Gender’)).value
#Returns age of specified participant
def getAge(ID):
return sheet.cell(getRowNum(ID), getColNum(‘Age (yr)’)).value