Having a list of boolean conditions list I would like to generate a matrix with the lists that have False or True values
For this example
values = [[True, False], [False], [True], [True, False]]
the result will be
False True
0 1 1
1 1 0
2 0 1
3 1 1
I tried to do that as following:
nodes = [True, False]
values = [[True, False], [False], [True], [True, False]]
res = np.array([[int(cond in vals) for vals in values] for cond in nodes],
dtype=[(node, int) for node in nodes])
But I am getting the error TypeError: data type not understood
dtypesuppose to represent? I thought it just needed to beintto specify that each value in the array is anintresvalues type.dtype=int? I think that is all you need for this to work...dtype=intthx