scikit-image/scikit-image — pull request #406 by blink1073 (2012-12-28 07:43:31+00:00)
Title: Bug adapthist py3k (fixes)

I'm with you @stefanv, 1-3% error did not sit well. It turns out it was a result of the division operator change between python versions.

The bug hunting method I used worked pretty well. I added a `save` function to `_adapthist`:

```python
def save(arr):
import sys
print(sys.version[0])
np.save('arr{0}.npy'.format(sys.version[0]), arr)
```

And then ran the script:
```
python _adapthist.py
python3 _adapthist.py
python check_output.py
```

where check_output.py is
```
import numpy as np
arr2 = np.load('arr2')
arr3 = np.load('arr3')
print(np.allclose(arr2, arr3))
```

I could then call `save`, walking it down one line at a time until I zeroed in on the failure.
There's probably a better way to do it, but it was kind of fun.