Can you help me, please:

Im doing a small module for calculations using dash, there is a table in which the filtered data from pandas.dataframe is output. There is a list of 10 variables (a values from the dropbox) that are passed to the function. How to automate this search so that this condition (pseudocode) :

list = (a, b, c, d, e, f, g, h, i, j)

if a == a and (b is None or len(b) ==0) and (c is None or lenĀ© ==0) and ā¦ (j is None or len(j)== 0):

return df(df[df[a].isin(a)).to_dict(ārecordsā)

if a == a and b == b (c is None or lenĀ© ==0) and (d is None or len(d) ==0) and ā¦ (j is None or len(j)== 0):

return df[(df[a].isin(a)) &

(df[b].isin(b))].to_dict(ārecordsā)

ā¦

if a == a and b == b and c == c ā¦ and i == i (c is None or lenĀ© ==0) and (d is None or len(d) ==0) and ā¦ (j is None or len(j)== 0):

return df[(df[a].isin(a)) &

(df[b].isin(b)) &

(df[c].isinĀ©) &

ā¦

(df[i].isin(i))].to_dict(ārecordsā)

Its look like, if you select a value from one dropbox, the dataframe is filtered by this value, the others are not taken into account; if two, then, respectively, filtered by these two values, the rest are not taken into account, etc.

Manually set for each a, b, c ā¦ this is more than 10!, which is exactly wrong.

No matter how I tried to use for i in list, but it does not wor a lot.