[datatable-help] Slow execution: Extracting last value in each group

Steve Lianoglou lianoglou.steve at gene.com
Fri Aug 16 09:01:49 CEST 2013


Hi Arun,

On Thu, Aug 15, 2013 at 11:27 PM, Arunkumar Srinivasan
<aragorn168b at gmail.com> wrote:
> Sorry, but I'm not sure what your question is here. There seems to be
> different timings between you and Steve. You want to get it verified as to
> which one is true? On my system, Steve's takes 0.003 seconds.

Actually, the issue was that (as far as I could tell) his code and my
code are exactly the same, but it runs orders of magnitude slower on
his machine than anywhere else I could test.

It doesn't make any sense -- perhaps I'm not looking close enough, but
I suggested he send it here so more eyes could see it, because I'm
stumped as to why/how that could happen.

> However, a *faster* version than Steve's solution (on bigger data) would be:
>
>     x[x[, .I[.N], by='Date']$V1]

Hah! Well done ;-)

-steve

-- 
Steve Lianoglou
Computational Biologist
Bioinformatics and Computational Biology
Genentech


More information about the datatable-help mailing list