Fix deprecated numpy code
Created by: smharper
I'm seeing a bunch of Travis failures due to a deprecation warning from calling numpy.sum()
on a generator. This PR should remove those warnings by replacing the numpy.sum()
call in question with a for
loop.