def idx_tuple_in_df(tuple_x, df):
    """Find the first row index of tuple_x in df."""

    res=None
    for i,v in enumerate(df.values):
        if tuple_x == tuple(v):
            res = i
            break
        else:
            res=None

    return res