Skip to content
Snippets Groups Projects
Commit ca22624e authored by tomrink's avatar tomrink
Browse files

minor

parent 7dccba2d
Branches
No related tags found
No related merge requests found
...@@ -109,6 +109,17 @@ def bin_data_by(a, b, bin_ranges): ...@@ -109,6 +109,17 @@ def bin_data_by(a, b, bin_ranges):
return binned_data return binned_data
def bin_data_by_edges(a, b, edges):
nbins = len(edges) - 1
binned_data = []
for i in range(nbins):
idxs = (b >= edges[i]) & (b < edges[i+1])
binned_data.append(a[idxs])
return binned_data
def get_bin_ranges(lop, hip, bin_size=100): def get_bin_ranges(lop, hip, bin_size=100):
bin_ranges = [] bin_ranges = []
delp = hip - lop delp = hip - lop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment