Consider a numpy array like this...
a = array([1, 7, 2, 8, 1, 2, 3, 8, 5])
Some of the array elements appear just once (ie 3, 5, and 7), but we are interested in the array elements that appear twice (ie 1, 2, and 8).
I need to find the GAP (index difference) between identical elements.
In the example...
Any help is greatly appreciated
Vicky C.
a = array([1, 7, 2, 8, 1, 2, 3, 8, 5])
Some of the array elements appear just once (ie 3, 5, and 7), but we are interested in the array elements that appear twice (ie 1, 2, and 8).
I need to find the GAP (index difference) between identical elements.
In the example...
Code:
element gap
--------------
1 4
2 3
8 4
Any help is greatly appreciated
Vicky C.