from labkey.utils import transform_helper

filepath = '${runInfo}'

def transform(grid):
    isHeaderChecked = False
    # iterate through the rows of your results data, checking for the header
    for row in grid:
        if isHeaderChecked == False:
            row.append('averageResult')
            isHeaderChecked = True
        else:
            # In this example, we are taking the average of the 3rd-5th column values by row
            # and appending that average value in a 6th column called "averageResult"
            newValTemp = sum([float(val) for val in row[2:]])/len(row[2:])
            row.append(round(newValTemp, 2))
    return grid

transform_helper(transform, filepath)