I'm trying to sample 1000 numbers between 0 and 999, with a vector of weights dictating the probability that a particular number will be chosen:

```
import numpy as np
resampled_indices = np.random.choice(a = 1000, size = 1000, replace = True, p = weights)

```

Unfortunately, this process has to be run thousands of times in a larger for loop, and it seems that `np.random.choice` is the main speed bottleneck in the process. As such, I was wondering if there's any way to speed up `np.random.choice` or to use an alternative method that gives the same results.