How can I calculate the average weight in python for two columns (x,y) data file, between 8<r< 9. in python

I have tried this put it dose not work with my

`np.average(X,Y, weights=[8,9])`

I have calculated the average weight which is 12.14, now I am trying to use this weight to calculate the average fro the X, Y values??

How can I do so ?