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 1.0 0
F16 0.0 0.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1
I want to apply this code:
m = df2.to_numpy()
mask = m * m[:, np.newaxis, :].transpose((0,2,1))
bol = mask.any(axis=1)
final = m | bol
But at the final step I get this error:
TypeError: ufunc 'bitwise_or' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Please tell me where is the mistake?