Patch extractor doesn't support float values for max patches

I got this error when using max_patches=0.1 with PatchExtractor:
```
ValueError: could not broadcast input array from shape (103632,7,7) into shape (0,7,7)
```

I solved the problem with an auxiliar function to avoid code duplication and I added a test.