BUG: upcast weights to average result type to avoid inaccuracies

closes gh-5202
Merge pull request #5214 from mkowoods/np.average

Update to average calculation