[Solved] Extracting the elements matching the filter
I’m basing this answer on a very similar answer I wrote just a few hours ago. #from sklearn.feature_extraction.image import extract_patches # similar to numpy’s stride_tricks from numpy.lib.stride_tricks import as_strided data = np.array([[1, 1 , 0 , 0 , 0 , 0 , 1 , 0], [1, 1 , 1 , 0 , 0 , 1 … Read more