On Thu, 07 Mar 2013 09:27:42 +, Sven wrote:
> Additionally, what if I wanted to pull a random element from N, but I
> want to ensure all elements from N have been used before starting to
> pick already chosen random elements again. So far I thought of
> duplicating the list and removing the ra
Am 08.03.2013 00:49, schrieb Alexander Blinne:
> http://docs.python.org/3/library/itertools.html#itertools.repeat
obviously I was aiming for
http://docs.python.org/2/library/itertools.html#itertools.cycle
here
Greetings
--
http://mail.python.org/mailman/listinfo/python-list
Am 07.03.2013 10:27, schrieb Sven:
> Now I would like to iterate over P and place one N at each point.
> However if you run out of N I'd like to restart from N[0] and carry on
> until all the points have been populated.
> So far I've got (pseudo code)
>
> i = 0
> for point in points:
> put N[i
In article ,
Sven wrote:
> I was wondering what the best approach for the following might be.
>
> Say you have a list P of points and another list N of other items. You can
> always assume that
>
> len(N) <= len(P)
>
> Now I would like to iterate over P and place one N at each point. However
On Mar 7, 2013 1:29 AM, "Sven" wrote:
>
> Stupid keyboard shortcuts, sent it too early. Apologies
>
>
> I was wondering what the best approach for the following might be.
>
> Say you have a list P of points and another list N of other items. You
can always assume that
>
> len(N) <= len(P)
>
> Now
On 7 March 2013 09:31, Chris Rebert wrote:
> On Mar 7, 2013 1:24 AM, "Sven" wrote:
> >
> > I was wondering what the best approach for the following might be.
> >
> > Say you have a list P of points and another list N of other items. You
> can always assume that
> >
> > len(N) <= len(P)
> >
> > N
On Mar 7, 2013 1:24 AM, "Sven" wrote:
>
> I was wondering what the best approach for the following might be.
>
> Say you have a list P of points and another list N of other items. You
can always assume that
>
> len(N) <= len(P)
>
> Now I would like to iterate over P and place one N at each point.
Stupid keyboard shortcuts, sent it too early. Apologies
I was wondering what the best approach for the following might be.
Say you have a list P of points and another list N of other items. You can
always assume that
len(N) <= len(P)
Now I would like to iterate over P and place one N at each p
On Thu, Mar 7, 2013 at 8:23 PM, Sven wrote:
> Now I would like to iterate over P and place one N at each point. However if
> you run out of N I'd like to restart from N[0] and carry on until all the
> points have been populated.
Check out itertools.cycle, it should do what you want.
ChrisA
--
h
I was wondering what the best approach for the following might be.
Say you have a list P of points and another list N of other items. You can
always assume that
len(N) <= len(P)
Now I would like to iterate over P and place one N at each point. However
if you run out of N I'd like to restart from
10 matches
Mail list logo