Weighted rolling average

My attempt at a weighted rolling average.  Doesn't force the weights to sum to 1.  If the min period is less than the length of the arrays, the nan value is skipped along with weighted value.  Should the weights be re-normed somehow?