I have data sampled at essentially random intervals. I would like to compute a weighted moving average using numpy (or other python package). I have a crude implementation o
You could use numpy.average which allows you to specify weights:
>>> bin_avg[index] = np.average(items_in_bin, weights=my_weights)
So to calculate the weights you could find the x coordinates of each data point in the bin and calculate their distances to the bin center.