I have a df with categories and thresholds:
cat t1 t2 t3 t4
a 2 4 6 8
b 3 5 7 0
c 0 0 1 0
My end goal is to return the column name given category and score. I can select a row using a cat variable:
df[df['cat'] == cat]
How do I now return the column name that is closest to the score (rounded down)? (c, 3) -> t3