Status: Valid
Owner: ----
Labels: Type-Defect Priority-Low
New issue 3620 by [email protected]: kbins unordered=00 could be better
http://code.google.com/p/sympy/issues/detail?id=3620
I just posted code at
http://stackoverflow.com/questions/5360220/how-to-split-a-list-into-pairs-in-all-possible-ways/14739406#14739406
that shows how to generate all possible pairs (regardless of the parity of
the input list length). It's a lot faster to do it this way than to use
kbins with the ordered=00 option and then filter the results. So this
issue is just a note that generating unordered results could probably be
optimized a bit.
```
t=time();ok = list(all_pairs(range(10)));time()-t
0.014999866485595703
kb = kbins(range(10),5,0)
t=time();no = [k for k in kb if all(len(p) <= 2 for p in k)];time()-t
0.76400017738342285
len(ok), len(no)
(945, 945)
```
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.