Created
January 14, 2018 12:49
-
-
Save sagarhowal/b45e58c4da39b13b7dfa04a8298dee17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_label_for_containing_interval(intervals, index): | |
containing_interval = intervals[:, 0][(intervals[:, 1] <= index) & (index <= intervals[:, 2])] | |
if len(containing_interval) == 1: | |
return containing_interval[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment