检查Python中的单元格行

检查Python中的单元格行,python,excel,pandas,rows,cells,Python,Excel,Pandas,Rows,Cells,我有一个函数来定义表中的单元格参数(我只将此函数应用于唯一的字符串,它工作得很好)。 但我如何在大数据集中确定单元格行,而不是在特定的数据帧中 下面是我检查整个df中的一行的函数: def check_row(cond_name): from xlrd import open_workbook book = open_workbook("output.xlsx") for sheet in book.sheets(): for rowidx in rang

我有一个函数来定义表中的单元格参数(我只将此函数应用于唯一的字符串,它工作得很好)。 但我如何在大数据集中确定单元格行,而不是在特定的数据帧中

下面是我检查整个df中的一行的函数:

def check_row(cond_name):
    from xlrd import open_workbook
    book = open_workbook("output.xlsx")
    for sheet in book.sheets():
        for rowidx in range(sheet.nrows):
            row = sheet.row(rowidx)
            for colidx, cell in enumerate(row):
                if cell.value == cond_name :
                    print("condition name is: ",cond_name)
                    return rowidx+1
但我也有子数据帧,比如
f_list=df['related findings'].values.tolist()[0:8]
,我需要确定列表中随机字符串的精确坐标(行和列)。
有可能吗?

您到底想实现什么?我想在数据帧子集中获得一个单元格行(特定字符串的第一次出现)。尝试简单地返回(rowidx+1,colidx+1)-->这应该返回列和行的坐标