[Numpy-discussion] Rebinning numpy array

Olivier Delalleau shish at keba.be
Sun Nov 13 13:03:55 EST 2011


2011/11/13 Robert Kern <robert.kern at gmail.com>

> On Sun, Nov 13, 2011 at 17:48, Olivier Delalleau <shish at keba.be> wrote:
> > Also: it seems like you are using values at the boundaries of the bins,
> > while I think it would make more sense to compute interpolated values at
> the
> > middle point of a bin. I'm not sure it'll make a big difference visually,
> > but it may be more appropriate.
>
> No, you do want to compute the interpolated values at the boundaries
> of the new bins. Then differencing the values at the boundaries will
> give you the correct values for the "mass" between the bounds.
>

I wrote this with non cumulative data in mind. However I just looked at
your suggestion, which is to accumulate data, and I agree it seems a better
way to achieve what the OP is trying to do, and in that case I agree that
computing interpolated values at the boundaries is the right way to go.
Sorry for the confusion,

-=- Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20111113/17c10848/attachment.html>


More information about the NumPy-Discussion mailing list