summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 3143c8846..44c31b8ec 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -64,6 +64,23 @@ def iterable(y):
return 1
def histogram(a, bins=10, range=None, normed=False):
+ """histogram(sample, bins = 10, range = None, normed = False) -> H, ledges
+
+ Return the distribution of a sample.
+
+ Parameters
+ ----------
+ bins: Number of bins
+ range: Lower and upper bin edges (default: [sample.min(), sample.max()]).
+ Does not really work, all values greater than range are stored in
+ the last bin.
+ normed: If False (default), return the number of samples in each bin.
+ If True, return a frequency distribution.
+
+ Output
+ ------
+ histogram array, left bin edges array.
+ """
a = asarray(a).ravel()
if not iterable(bins):
if range is None: