import itertools
inputs = {
"a": [True, False],
"b": [True, False],
"c": [0.0, 0.1, 0.2],
"d": [0.0, 0.1, 0.2, 0.3],
}
bool_inputs = {"a", "b"}
float_inputs = {"c", "d"}
columns = list(inputs)
float_indexes = [columns.index(f) for f in float_inputs]
data = (t for t in itertools.product(*inputs.values()) if sum(t[i] > 0 for i in float_indexes) <= 1)
df = pd.DataFrame(data, columns=columns).reset_index(drop=True)
Output:
a b c d
0 True True 0.0 0.0
1 True True 0.0 0.1
2 True True 0.0 0.2
3 True True 0.0 0.3
4 True True 0.1 0.0
5 True True 0.2 0.0
6 True False 0.0 0.0
7 True False 0.0 0.1
8 True False 0.0 0.2
9 True False 0.0 0.3
10 True False 0.1 0.0
11 True False 0.2 0.0
12 False True 0.0 0.0
13 False True 0.0 0.1
14 False True 0.0 0.2
15 False True 0.0 0.3
16 False True 0.1 0.0
17 False True 0.2 0.0
18 False False 0.0 0.0
19 False False 0.0 0.1
20 False False 0.0 0.2
21 False False 0.0 0.3
22 False False 0.1 0.0
23 False False 0.2 0.0