Skip to content

Commit

Permalink
Reproduce matplotlib.mlab.find
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasnehme authored Sep 16, 2021
1 parent 6cc5300 commit 97ababc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tracpy/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* convert_indices
* check_points
* seed
* find
"""

import numpy as np
Expand Down Expand Up @@ -476,3 +477,13 @@ def make_proj(setup='nwgom', usebasemap=True, **kwargs):
proj = Proj(**inputs)

return proj


def find(condition):
"""
https://github.com/kthyng/tracpy/issues/12#issuecomment-555493595
"""

res, = np.nonzero(np.ravel(condition))

return res

0 comments on commit 97ababc

Please sign in to comment.