I bet this can be collapsed quite a bit. Check this out (just learned about roll the other day and its awesome...):

```python
11:20:41 (mcdonadt@Daniels-MacBook-Pro-2):/Users/mcdonadt
> a = array([1, 1, 2, 3, 4, 4, 5])

11:22:58 (mcdonadt@Daniels-MacBook-Pro-2):/Users/mcdonadt
> b = np.roll(a == np.roll(a, 1), -1)

11:23:03 (mcdonadt@Daniels-MacBook-Pro-2):/Users/mcdonadt
> b
Out[13]: array([ True, False, False, False,  True, False, False], dtype=bool)
```

That gives where the ties are, ie:

```python
tie_count = b.sum()
ties = ranks[b]  # assuming ranks comes in as a numpy array which is straight forward
result = where(b, ranks, nan)
```

Averaging, and replacing the `nan`'s requires a slightly different approach to `_get_adjusted_vals`, which I believe boils down to finding consecutive `True`s in `b`. An example of doing that can be found [here](http://stackoverflow.com/questions/4494404/find-large-number-of-consecutive-values-fulfilling-condition-in-a-numpy-array). I suspect there is room for a lot of awesome there too.

BTW, these are just suggestions, particularly if these are performance bound methods.