I have two dataframes the same size (3 by 3), one is Logical (True/False) and the other is numerical:

My script allows the user to input a specific coordinate from the Logical Matrix in order to change it from False to True (if it is already True, just ignores the command). After that, I want to apply the style.applymap function to color the elements in my numerical df corresponding to the True values.
style.applymap(func, subset=((row), [columns])
Thus, my approach was to save the indexes of the True values and add them to the subset using my numerical df. However, I cannot add my specific indexes on the subset field nor add more than one row in the subset parameter. So far, my code goes like this:
Occupato = pd.DataFrame(np.zeros(shape = (3, 3)))
for i in range(3):
Occupato = Occupato.astype({i: bool})
normale = pd.DataFrame(np.random.randint(0,10,size=(3, 3)), columns=list('ABC'))
def colore(v, colore):
# if v:
return f"background-color: {colore};"
idx = ('Insert coordinates as [x, y]: ')
Occupato.iloc[idx[0], idx[1]]
normale.style.applymap(colore, colore='blue', subset = (row), [columns])
Now, I find it weird to see the syntax for the subset, using parenthesis () for rows -and only accepting one integer- whereas for columns, square brackets[] and allowing multiple values. Thanks in advance.
I tried:
mydf.style.applymap(colore, colore='blue', subset = (rows), [columns])
I expected to obtain the list elements specified on the subset and colored blue. Instead I obtained:
KeyError: "None of [Index([(1, 2)], dtype='object')] are in the [index]"
