it may be worth rewriting this as:

```python
perm_t_stats = zeros(permutations, dtype=float)
for n in range(permutations):
    perm_t_stats[n] = ...
```

The benefit is sticking within numpy instead of going back and forth between numpy and python. It is possible this could also be done with `np.apply_along_axis` if `perm_x_items` and `perm_y_items` came in as a `(2, n)` shaped array, in which case the for loop would be removed