Comment

Comment by iwonthecase

Yeah, Pandas would provide a pretty big improvement, but I wonder how much of an improvement one could get even by just replacing the c-style loop:

> for qs in combinations(all_qs, K):

> > ...

> > corrs.append({'qs': qs, 'r': r})

>

> corrs.sort_values(...)

with a python style list comprehension:

> def build_q(combination):

> > ...

> > return {'qs': qs, 'r': r}

>

> max(build_q(c) for c in combinations(all_qs, K), key = lambda v: v['r'])

parent iwonthecase 3 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton