def find_within_ordmag(x, baseline_idx):
x_ascending = np.sort(x)
baseline = x_ascending[-baseline_idx]
cutoff = max(1, round(0.1*baseline))
# Return the index corresponding to the cutoff in descending order
return len(x) - np.searchsorted(x_ascending, cutoff)
评论列表
文章目录