I am computing the weighted average of the positions of certain particles, type error

So I am trying to compute the weighted average of my particles, given some weights that I have. The dimension of the particles is 100x2 and the weights is 1x100. I keep getting the error below.

def estimate(particles, weights):
    mean = np.average(particles, weights)
    var = np.average((particles - mean)**2, weights, axis=0)
    return mean, var
/Users/scottdayton/PycharmProjects/Uncertainty Research/particle.py:28: RuntimeWarning: overflow encountered in true_divide
  weights /= n
/Users/scottdayton/PycharmProjects/Uncertainty Research/particle.py:26: RuntimeWarning: invalid value encountered in multiply
  weights[i] *= likelihood
Traceback (most recent call last):
  File "/Users/scottdayton/PycharmProjects/Uncertainty Research/particle.py", line 84, in <module>
    particle_filter(init, sigma, obs, n, trans, sigma0)
  File "/Users/scottdayton/PycharmProjects/Uncertainty Research/particle.py", line 58, in particle_filter
    mean_and_vars[i] = estimate(particles, weights)
  File "/Users/scottdayton/PycharmProjects/Uncertainty Research/particle.py", line 31, in estimate
    mean = np.average(particles, weights)
  File "<__array_function__ internals>", line 6, in average
  File "/usr/local/lib/python3.7/site-packages/numpy/lib/function_base.py", line 393, in average
    avg = a.mean(axis)
  File "/usr/local/lib/python3.7/site-packages/numpy/core/_methods.py", line 138, in _mean
    rcount = _count_reduce_items(arr, axis)
  File "/usr/local/lib/python3.7/site-packages/numpy/core/_methods.py", line 57, in _count_reduce_items
    items *= arr.shape[ax]
TypeError: only integer scalar arrays can be converted to a scalar index