Skip to content

Commit 51da9b9

Browse files
Fix docstring
1 parent cbb3acf commit 51da9b9

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

dpnp/dpnp_iface_histograms.py

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,6 @@ def histogram_bin_edges(a, bins=10, range=None, weights=None):
756756

757757

758758
def histogram2d(x, y, bins=10, range=None, density=None, weights=None):
759-
# pylint: disable=line-too-long
760759
"""
761760
Compute the bi-dimensional histogram of two data samples.
762761
@@ -768,9 +767,8 @@ def histogram2d(x, y, bins=10, range=None, density=None, weights=None):
768767
y : {dpnp.ndarray, usm_ndarray} of shape (N,)
769768
An array containing the `y` coordinates of the points to be
770769
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
774772
775773
The bins specification:
776774
@@ -784,30 +782,38 @@ def histogram2d(x, y, bins=10, range=None, density=None, weights=None):
784782
* A combination [int, array] or [array, int], where int
785783
is the number of bins and array is the bin edges.
786784
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
788787
The leftmost and rightmost edges of the bins along each dimension
789788
(if not specified explicitly in the `bins` parameters):
790789
``[[xmin, xmax], [ymin, ymax]]``. All values outside of this range
791790
will be considered outliers and not tallied in the histogram.
791+
792+
Default: ``None``
792793
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.
794796
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
797801
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.
801806
807+
Default: ``None``
802808
Returns
803809
-------
804810
H : dpnp.ndarray of shape (nx, ny)
805811
The bi-dimensional histogram of samples `x` and `y`. Values in `x`
806812
are histogrammed along the first dimension and values in `y` are
807813
histogrammed along the second dimension.
808-
xedges : dpnp.ndarray, shape(nx+1,)
814+
xedges : dpnp.ndarray of shape (nx+1,)
809815
The bin edges along the first dimension.
810-
yedges : dpnp.ndarray, shape(ny+1,)
816+
yedges : dpnp.ndarray of shape (ny+1,)
811817
The bin edges along the second dimension.
812818
813819
See Also
@@ -843,7 +849,6 @@ def histogram2d(x, y, bins=10, range=None, density=None, weights=None):
843849
>>> edges_y
844850
[-1.1889046 -0.07263839 1.0436279 2.159894 ]
845851
"""
846-
# pylint: enable=line-too-long
847852

848853
dpnp.check_supported_arrays_type(x, y)
849854
if weights is not None:
@@ -1066,7 +1071,7 @@ def _histdd_extract_arrays(sample, weights, bins):
10661071
return all_arrays
10671072

10681073

1069-
def histogramdd(sample, bins=10, range=None, density=False, weights=None):
1074+
def histogramdd(sample, bins=10, range=None, density=None, weights=None):
10701075
"""
10711076
Compute the multidimensional histogram of some data.
10721077
@@ -1093,6 +1098,13 @@ def histogramdd(sample, bins=10, range=None, density=False, weights=None):
10931098
values being used for the corresponding dimension.
10941099
None is equivalent to passing a tuple of D None values.
10951100
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+
10961108
Default: ``None``
10971109
weights : {dpnp.ndarray, usm_ndarray}, optional
10981110
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):
11021114
weights belonging to the samples falling into each bin.
11031115
11041116
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``
11111117
11121118
Returns
11131119
-------

0 commit comments

Comments
 (0)