I have a NumPy array:
[[ 0. 1. 2. 3. 4.]
[ 7. 8. 9. 10. 4.]
[ 14. 15. 16. 17. 4.]
[ 1. 20. 21. 22. 23.]
[ 27. 28. 1. 20. 29.]]
which I want to quickly find the coordinates of specific values and avoid Python loops on the array. For example the number 4
is on:
row 0 and col 4
row 1 and col 4
row 2 and col 4
and a search function should return a tuple:
((0,4),(1,4),(2,4))
Can this be done directly via NunmPy's functions?