[SciPy-User] Averaging over unevenly-spaced records

Camilo Polymeris cpolymeris@gmail....
Sun Oct 16 17:24:54 CDT 2011


On Sun, Oct 16, 2011 at 7:18 PM, nicky van foreest <vanforeest@gmail.com> wrote:
> Hi,
>
> Have you perhaps considered using itertools.groupby? Like this you can
> group elements by datetime at second accuracy (use a key function that
> strips all subsecond accuracy from your datetime objects). Then just
> sum over your colums A and B, and divide for the average by the lenght
> of the group.

That seems like a better approach. Thanks!

Camilo


More information about the SciPy-User mailing list