sbrisard / rebin

Python/numpy implementation of IDL's rebin array
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

func=np.sum vs. np.mean #1

Open gjkunde opened 1 year ago

gjkunde commented 1 year ago

Hello,

It appears that np.sum and np.mean result in the same numbers, at least for 1d arrays I tried. I would have expected that mean takes out the bin scaling ?

Respectfully Gerd

sbrisard commented 1 year ago

Hello, thank you for reporting this issue. This would indeed be a bug, but I can't reproduce it

>>> rebin.rebin([1, 2, 3, 4, 5, 6], 2, np.sum)
array([ 3,  7, 11])
>>> rebin.rebin([1, 2, 3, 4, 5, 6], 2, np.mean)
array([1.5, 3.5, 5.5])

Could you provide a MWE?