Any Python experts? Need help

In the below code am trying to check if subregions in df1SubRegion List are a subset of subregions in SubRegion List and send any outliars to error log. Below code is taking too long to run. Can anyone suggest an easier way with less run time to achieve this?

    xls = pd.ExcelFile(MarketGeographyfullinputfilename)
    dfSubRegion = pd.read_excel(xls, 'Sub-region')
    SubRegionList = dfSubRegion["SubRegion_Long"].tolist()

    SubRegionList = dfSubRegion["SubRegion_Long"].tolist()
    df1SubRegionList = df1["Sub-Region"].tolist()
    df1SubRegionList = list(set(df1SubRegionList))

    for val in df1SubRegionList:
        if val in SubRegionList:
            QCChecklist = openpyxl.load_workbook(Checklistfullfilename)
            QCChecklistsheet = QCChecklist.active
            QCChecklistsheet["B15"] = "X"
            QCChecklistsheet["C15"] = ""
            QCChecklist.save(Checklistfullfilename)
        else:
            dfSubRegionNotinFormat = df1[df1["Sub-Region"] == val]

            QCChecklist = openpyxl.load_workbook(Checklistfullfilename)
            QCChecklistsheet = QCChecklist.active
            QCChecklistsheet["C15"] = "X"
            QCChecklistsheet["B15"] = ""
            QCChecklist.save(Checklistfullfilename)
            dfSubRegionNotinFormat['Comment'] = 'Sub Region does not exist in SubRegion Taxomomy'
            reader = pd.read_csv(Logfullfilename, chunksize=1)
            write_header = False
            dfSubRegionNotinFormat.to_csv(Logfullfilename, mode='a', header=write_header, index=False)

@Harshithh

2 Likes