I am new to python so please be nice.
I am trying to compare two Numpy arrays with the np.logical_or
function. When I run the below code an error appears on thePercentile = np.logical_or(data2 > Per1, data2 < Per2)
line stating
ValueError: operands could not be broadcast together with shapes (2501,201) (2501,)
data = 1st Array
data2 = 2nd Array
Per1 = np.percentile(data, 10, axis=1)
Per2 = np.percentile(data, 90, axis=1)
Percentile = np.logical_or(data2 > Per1, data2 < Per2)
print(Percentile)
I have checked the shape of both arrays and they both appear to be of the same shape (2501,201)
(2501,201)
. Therefore I am struggling to understand why this error occurs, any help would be greatly appreciated.