DOC: Explain why bincount is used to histogram integer arrays.

This commit is contained in:
Stefan van der Walt
2011-12-26 01:53:59 -08:00
parent 60f146c780
commit d74295c7f1
+2
View File
@@ -28,6 +28,8 @@ def histogram(image, nbins=256):
bin_centers : array
The values at the center of the bins.
"""
# For integer types, histogramming with bincount is more efficient.
if np.issubdtype(image.dtype, np.integer):
offset = 0
if np.min(image) < 0: