Skip to content

Instantly share code, notes, and snippets.

@palcu
Last active December 29, 2015 11:49
Show Gist options
  • Save palcu/7666276 to your computer and use it in GitHub Desktop.
Save palcu/7666276 to your computer and use it in GitHub Desktop.
# get left right indices
l = [i for i, x in enumerate(m[0]) if x]
left = l[0]
right = l[-1] + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment