Skip to content

Commit

Permalink
Merge pull request #105 from blowekamp/docs_quantile
Browse files Browse the repository at this point in the history
Fix doc formatting for weighted_quantile
  • Loading branch information
blowekamp authored Feb 27, 2024
2 parents ebed866 + 025ab38 commit 64a3b40
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pytools/utils/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@

def weighted_quantile(values, quantiles, sample_weight=None, values_sorted=False, old_style=False):
"""Very close to numpy.percentile, but supports weights.
NOTE: quantiles should be in [0, 1]!
.. note:: quantiles should be in [0, 1]!
:param values: numpy.array with data
:param quantiles: array-like with many quantiles needed
:param sample_weight: array-like of the same length as `array`
:param values_sorted: bool, if True, then will avoid sorting of
initial array
initial array
:param old_style: if True, will correct output to be consistent
with numpy.percentile.
with numpy.percentile.
:return: numpy.array with computed quantiles.
"""
values = np.array(values)
Expand Down

0 comments on commit 64a3b40

Please sign in to comment.