Re: combinatorics via __future__ generators

2009-12-01 Thread John Yeung
On Dec 1, 5:55 pm, Phlip wrote: > Awesome thanks - but: > > > from itertools import imap,product > > Do we have a version for Python2.5? I have to support an older server > here; can't install a newer python on it... If you can get by with the performance of pure Python, a solution is right in th

Re: combinatorics via __future__ generators

2009-12-01 Thread Phlip
Awesome thanks - but: > from itertools import imap,product Do we have a version for Python2.5? I have to support an older server here; can't install a newer python on it... -- http://mail.python.org/mailman/listinfo/python-list

Re: combinatorics via __future__ generators

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 4:58 PM, Phlip wrote: > Python: > > I have a quaint combinatorics problem. Before I solve it, or find a > solution among "generators", I thought y'all might like to show off > any solutions. > > Given an array like this... > >  [0, 4, 3] > > Produce an array like this: > >

Re: combinatorics via __future__ generators

2009-11-18 Thread Phlip
On Nov 18, 4:58 pm, Phlip wrote: > Python: > > I have a quaint combinatorics problem. Before I solve it, or find a > solution among "generators", I thought y'all might like to show off > any solutions. > > Given an array like this... > >   [0, 4, 3] > > Produce an array like this: > >   [ >     [0

Re: Combinatorics

2008-02-13 Thread Paul Hankin
On Feb 12, 7:52 am, Michael Robertson <[EMAIL PROTECTED]> wrote: > Where is the python equivalent of: > > http://search.cpan.org/~fxn/Algorithm-Combinatorics-0.16/Combinatoric... > > combinations (with and without repetition) > variations (with and without repetition) > permutations > partitions >

Re: Combinatorics

2008-02-13 Thread Thorsten Kampe
* Michael Robertson (Mon, 11 Feb 2008 23:52:31 -0800) > Where is the python equivalent of: > > http://search.cpan.org/~fxn/Algorithm-Combinatorics-0.16/Combinatorics.pm > > combinations (with and without repetition) > variations (with and without repetition) > permutations Permutations are also

Re: Combinatorics

2008-02-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >Cameron Laird: >> It does occur to me, though, that even more widely applicable >> than the combinatorics module of Mathematica (if only because of >> its licensing) might be such resources as > >What I was trying to say is that that Math

Re: Combinatorics

2008-02-12 Thread Raymond Hettinger
On Feb 11, 11:52 pm, Michael Robertson <[EMAIL PROTECTED]> wrote: > Where is the python equivalent of: > > http://search.cpan.org/~fxn/Algorithm-Combinatorics-0.16/Combinatoric... > > combinations (with and without repetition) > variations (with and without repetition) > permutations > partitions >

Re: Combinatorics

2008-02-12 Thread Jaap Spies
Robert Dodier wrote: > Cameron Laird wrote: > >> Should combinatorics be part of the standard library? That's >> an aesthetic-pragmatic question I don't feel competent to >> answer; I look to timbot and Guido and so on for judgment there. >> It does occur to me, though, that even more widely appl

Re: Combinatorics

2008-02-12 Thread [EMAIL PROTECTED]
On Feb 12, 1:52 am, Michael Robertson <[EMAIL PROTECTED]> wrote: > Where is the python equivalent of: > > http://search.cpan.org/~fxn/Algorithm-Combinatorics-0.16/Combinatoric... > > combinations (with and without repetition) > variations (with and without repetition) > permutations > partitions >

Re: Combinatorics

2008-02-12 Thread bearophileHUGS
Cameron Laird: > It does occur to me, though, that even more widely applicable > than the combinatorics module of Mathematica (if only because of > its licensing) might be such resources as What I was trying to say is that that Mathematica combinatorics module contains lots and lots and lots of th

Re: Combinatorics

2008-02-12 Thread Robert Dodier
Cameron Laird wrote: > Should combinatorics be part of the standard library? That's > an aesthetic-pragmatic question I don't feel competent to > answer; I look to timbot and Guido and so on for judgment there. > It does occur to me, though, that even more widely applicable > than the combinatori

Re: Combinatorics

2008-02-12 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >Michael Robertson: >> I'm guessing sage has this, but shouldn't something like this be part of >> the standard library (perhaps in C)? > >My answer is positive. As a reference point you can look at the >combinatorics module of Mathematica

Re: Combinatorics

2008-02-12 Thread Steven D'Aprano
On Tue, 12 Feb 2008 10:38:53 +0100, pataphor wrote: > On Mon, 11 Feb 2008 23:52:31 -0800 > Michael Robertson <[EMAIL PROTECTED]> wrote: > >> Am I wishing on a star? > > for i in xrange(10**10): > print i > OverflowError: long int too large to convert to int > > The problem seems to be that

Re: Combinatorics

2008-02-12 Thread pataphor
On Mon, 11 Feb 2008 23:52:31 -0800 Michael Robertson <[EMAIL PROTECTED]> wrote: > Am I wishing on a star? for i in xrange(10**10): print i OverflowError: long int too large to convert to int The problem seems to be that although python supports arbitrary long integers, all the internal loop

Re: Combinatorics

2008-02-12 Thread bearophileHUGS
Michael Robertson: > I'm guessing sage has this, but shouldn't something like this be part of > the standard library (perhaps in C)? My answer is positive. As a reference point you can look at the combinatorics module of Mathematica. Bye, bearophile -- http://mail.python.org/mailman/listinfo/pyt