Skip to content

Commit

Permalink
Merge pull request #65 from dougiesquire/pass_weights_to_hist_bin_edges
Browse files Browse the repository at this point in the history
Pass weights to histogram_bin_edges
  • Loading branch information
TomNicholas committed Jun 21, 2021
2 parents 38becf6 + f1cd62b commit 3e7e1c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xhistogram/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,10 @@ def histogram(
)
else:
bins = [
np.histogram_bin_edges(a, b, r) for a, b, r in zip(all_arrays, bins, range)
np.histogram_bin_edges(
a, bins=b, range=r, weights=all_arrays[-1] if has_weights else None
)
for a, b, r in zip(all_arrays, bins, range)
]
bincount_kwargs = dict(
weights=has_weights,
Expand Down

0 comments on commit 3e7e1c1

Please sign in to comment.