@@ -756,7 +756,6 @@ def histogram_bin_edges(a, bins=10, range=None, weights=None):
756
756
757
757
758
758
def histogram2d (x , y , bins = 10 , range = None , density = None , weights = None ):
759
- # pylint: disable=line-too-long
760
759
"""
761
760
Compute the bi-dimensional histogram of two data samples.
762
761
@@ -768,9 +767,8 @@ def histogram2d(x, y, bins=10, range=None, density=None, weights=None):
768
767
y : {dpnp.ndarray, usm_ndarray} of shape (N,)
769
768
An array containing the `y` coordinates of the points to be
770
769
histogrammed.
771
- bins : {int, list of dpnp.ndarray or usm_ndarray, sequence of scalars}, \
772
- optional
773
- Histogram bins.
770
+ bins : {int, dpnp.ndarray, usm_ndarray, [int, int], [array, array], \
771
+ [int, array], [array, int]}, optional
774
772
775
773
The bins specification:
776
774
@@ -784,30 +782,38 @@ def histogram2d(x, y, bins=10, range=None, density=None, weights=None):
784
782
* A combination [int, array] or [array, int], where int
785
783
is the number of bins and array is the bin edges.
786
784
787
- range : {dpnp.ndarray, usm_ndarray} of shape (2,2), optional
785
+ Default: ``None``
786
+ range : {None, dpnp.ndarray, usm_ndarray} of shape (2,2), optional
788
787
The leftmost and rightmost edges of the bins along each dimension
789
788
(if not specified explicitly in the `bins` parameters):
790
789
``[[xmin, xmax], [ymin, ymax]]``. All values outside of this range
791
790
will be considered outliers and not tallied in the histogram.
791
+
792
+ Default: ``None``
792
793
density : {None, bool}, optional
793
- If ``False``, the default, returns the number of samples in each bin.
794
+ If ``False`` or ``None``, the default, returns the number of
795
+ samples in each bin.
794
796
If ``True``, returns the probability *density* function at the bin,
795
- ``bin_count / sample_count / bin_area``.
796
- weights : {dpnp.ndarray, usm_ndarray} of shape (N,), optional
797
+ ``bin_count / sample_count / bin_volume``.
798
+
799
+ Default: ``None``
800
+ weights : {None, dpnp.ndarray, usm_ndarray} of shape (N,), optional
797
801
An array of values ``w_i`` weighing each sample ``(x_i, y_i)``.
798
- Weights are normalized to ``1`` if `density` is ``True``. If `density` is
799
- ``False``, the values of the returned histogram are equal to the sum of
800
- the weights belonging to the samples falling into each bin.
802
+ Weights are normalized to ``1`` if `density` is ``True``.
803
+ If `density` is ``False``, the values of the returned histogram
804
+ are equal to the sum of the weights belonging to the samples
805
+ falling into each bin.
801
806
807
+ Default: ``None``
802
808
Returns
803
809
-------
804
810
H : dpnp.ndarray of shape (nx, ny)
805
811
The bi-dimensional histogram of samples `x` and `y`. Values in `x`
806
812
are histogrammed along the first dimension and values in `y` are
807
813
histogrammed along the second dimension.
808
- xedges : dpnp.ndarray, shape(nx+1,)
814
+ xedges : dpnp.ndarray of shape (nx+1,)
809
815
The bin edges along the first dimension.
810
- yedges : dpnp.ndarray, shape(ny+1,)
816
+ yedges : dpnp.ndarray of shape (ny+1,)
811
817
The bin edges along the second dimension.
812
818
813
819
See Also
@@ -843,7 +849,6 @@ def histogram2d(x, y, bins=10, range=None, density=None, weights=None):
843
849
>>> edges_y
844
850
[-1.1889046 -0.07263839 1.0436279 2.159894 ]
845
851
"""
846
- # pylint: enable=line-too-long
847
852
848
853
dpnp .check_supported_arrays_type (x , y )
849
854
if weights is not None :
@@ -1066,7 +1071,7 @@ def _histdd_extract_arrays(sample, weights, bins):
1066
1071
return all_arrays
1067
1072
1068
1073
1069
- def histogramdd (sample , bins = 10 , range = None , density = False , weights = None ):
1074
+ def histogramdd (sample , bins = 10 , range = None , density = None , weights = None ):
1070
1075
"""
1071
1076
Compute the multidimensional histogram of some data.
1072
1077
@@ -1093,6 +1098,13 @@ def histogramdd(sample, bins=10, range=None, density=False, weights=None):
1093
1098
values being used for the corresponding dimension.
1094
1099
None is equivalent to passing a tuple of D None values.
1095
1100
1101
+ Default: ``None``
1102
+ density : {None, bool}, optional
1103
+ If ``False`` or ``None``, the default, returns the number of
1104
+ samples in each bin.
1105
+ If ``True``, returns the probability *density* function at the bin,
1106
+ ``bin_count / sample_count / bin_volume``.
1107
+
1096
1108
Default: ``None``
1097
1109
weights : {dpnp.ndarray, usm_ndarray}, optional
1098
1110
An (N,)-shaped array of values `w_i` weighing each sample
@@ -1102,12 +1114,6 @@ def histogramdd(sample, bins=10, range=None, density=False, weights=None):
1102
1114
weights belonging to the samples falling into each bin.
1103
1115
1104
1116
Default: ``None``
1105
- density : bool, optional
1106
- If ``False``, the default, returns the number of samples in each bin.
1107
- If ``True``, returns the probability *density* function at the bin,
1108
- ``bin_count / sample_count / bin_volume``.
1109
-
1110
- Default: ``False``
1111
1117
1112
1118
Returns
1113
1119
-------
0 commit comments