Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79e482a

Browse files
committed
DOC: Document the surprising behaviour of np.histogramdd on array_likes
1 parent 992163e commit 79e482a

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

numpy/lib/histograms.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -779,10 +779,18 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
779779
780780
Parameters
781781
----------
782-
sample : array_like
783-
The data to be histogrammed. It must be an (N,D) array or data
784-
that can be converted to such. The rows of the resulting array
785-
are the coordinates of points in a D dimensional polytope.
782+
sample : (N, D) array, or (D, N) array_like
783+
The data to be histogrammed.
784+
785+
Note the unusual interpretation of sample when an array_like:
786+
787+
* When an array, each row is a coordinate in a D-dimensional space -
788+
such as ``histogramgramdd(np.array([p1, p2, p3]))``.
789+
* When an array_like, each element is the list of values for single
790+
coordinate - such as ``histogramgramdd((X, Y, Z))``.
791+
792+
The first form should be preferred.
793+
786794
bins : sequence or int, optional
787795
The bin specification:
788796

0 commit comments

Comments
 (0)