If the dataframe has values outside the min1, max1, etc bounds, histogram2d will try to put these values into the output array but that will result in out-of-bounds errors.
I've pushed a branch issue12_histogram which fixes this and switches to using integers for bins. There were some weird effects where certain columns or rows had all zeros, I'm guessing due to some rounding issues.
If the dataframe has values outside the min1, max1, etc bounds, histogram2d will try to put these values into the output array but that will result in out-of-bounds errors.