def findLastMatchRow(self, columnIndex, value):
        if os.path.exists(self.csvFilePath):
            with open(self.csvFilePath, 'r+b') as csvfileReader:
                reader = csv.reader(csvfileReader)
                rows = [row for row in reader if row[columnIndex + 1] == value]
                # print("DEBUG. Rows:")
                # import pprint
                # pprint.pprint(rows)
                if len(rows) > 0:
                    # Get the last element
                    return rows.pop()
        # Not found
        return None
Go over all the rows in the CSV until it finds the value "value" in the column "columnName"
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/CIP_Common/CIP/ui/CaseReportsWidget.py/CaseReportsLogic.findLastMatchRow