On Jan 29, 7:07 pm, Steven D'Aprano wrote:
> On Fri, 29 Jan 2010 14:49:06 -0800, Jonathan Gardner wrote:
> > On Jan 28, 3:52 pm, elsa wrote:
>
> >> I've got a problem with my program, in that the code just takes too
> >> long to run. Here's what I'm doing. If anyone has any tips, they'd be
> >> m
On Mon, 01 Feb 2010 14:04:01 -0800, Jonathan Gardner wrote:
> Having worked with datasets that are truly enormous, whenever I see a
> list that is unbounded (as this appears to be), I freak out because
> unbounded can be a really, really big number. Might as well write
> software that works for th
On Fri, 29 Jan 2010 14:49:06 -0800, Jonathan Gardner wrote:
> On Jan 28, 3:52 pm, elsa wrote:
>>
>> I've got a problem with my program, in that the code just takes too
>> long to run. Here's what I'm doing. If anyone has any tips, they'd be
>> much appreciated!
>>
>>
> First of all, don't play wi
On Jan 28, 3:52 pm, elsa wrote:
>
> I've got a problem with my program, in that the code just takes too
> long to run. Here's what I'm doing. If anyone has any tips, they'd be
> much appreciated!
>
First of all, don't play with large lists. Large lists have a tendency
to grow larger over time, un
On Thu, Jan 28, 2010 at 5:52 PM, elsa wrote:
>choice = random.choice(range(1,sum([i[0] for i in myList])+1))
>
That's the line causing the problem. It's generating all of the numbers
between 1 and your sum, then picking one. Try the following instead, which
will pick a number between 1
Steve Holden wrote:
Dave Angel wrote:
elsa wrote:
Hi guys,
I've got a problem with my program, in that the code just takes too
long to run. Here's what I'm doing. If anyone has any tips, they'd be
much appreciated!
So, say I have a list of lists that looks something like this (I'm
usi
Steve Holden wrote:
> Dave Angel wrote:
>> elsa wrote:
>>> Hi guys,
>>>
>>> I've got a problem with my program, in that the code just takes too
>>> long to run. Here's what I'm doing. If anyone has any tips, they'd be
>>> much appreciated!
>>>
>>> So, say I have a list of lists that looks something
Dave Angel wrote:
> elsa wrote:
>> Hi guys,
>>
>> I've got a problem with my program, in that the code just takes too
>> long to run. Here's what I'm doing. If anyone has any tips, they'd be
>> much appreciated!
>>
>> So, say I have a list of lists that looks something like this (I'm
>> using a lis
if you're open to other libraries, this could be done extremely fast in
numpy.
On my machine summing that whole array takes 75ms.
On Thu, Jan 28, 2010 at 8:00 PM, Steven D'Aprano <
st...@remove-this-cybersource.com.au> wrote:
> On Thu, 28 Jan 2010 15:52:14 -0800, elsa wrote:
>
> > Now, what I ne
elsa wrote:
Hi guys,
I've got a problem with my program, in that the code just takes too
long to run. Here's what I'm doing. If anyone has any tips, they'd be
much appreciated!
So, say I have a list of lists that looks something like this (I'm
using a list of lists, rather than a list of tuples
On Thu, 28 Jan 2010 15:52:14 -0800, elsa wrote:
> Now, what I need to do is randomly choose one myList[i], however the
> distribution of my random choice needs to be proportional to the values
> of myList[i][0]. So, for this list above, I'd have a much higher chance
> of choosing myList[0] than my
On 1/28/2010 6:52 PM, elsa wrote:
Hi guys,
I've got a problem with my program, in that the code just takes too
long to run. Here's what I'm doing. If anyone has any tips, they'd be
much appreciated!
So, say I have a list of lists that looks something like this (I'm
using a list of lists, rather
elsa wrote:
> Hi guys,
>
> I've got a problem with my program, in that the code just takes too
> long to run. Here's what I'm doing. If anyone has any tips, they'd be
> much appreciated!
>
> So, say I have a list of lists that looks something like this (I'm
> using a list of lists, rather than a
Hi guys,
I've got a problem with my program, in that the code just takes too
long to run. Here's what I'm doing. If anyone has any tips, they'd be
much appreciated!
So, say I have a list of lists that looks something like this (I'm
using a list of lists, rather than a list of tuples, as I need it
14 matches
Mail list logo