I have a one dimensional array of boolean value that I am trying to bin (averager over larger bins) in a way that if a bin is True if any of the values inside is True.
I have been trying to do it in the fashion of https://stackoverflow.com/a/21712136/3275464
import numpy as N
data = N.random.randint(2,size=100).astype(bool) #generating array of random booleans
bins = N.linspace(0,100,11,1).astype(int) #the array containing the bins
binned_data = N.logical_or.reduceat(data,bins[:-1])
but the last line gives me the following error:
TypeError: array cannot be safely cast to required type
It seems to me that it should work just as it does with averaging.
I am using numpy 1.6.2 by the way.
Do you see where I am committing a mistake?