[EMAIL PROTECTED] wrote:
> X-No-Archive: yes
> Can some one help me improve this block of code...this jus converts the
> list of data into tokens based on the range it falls into...but it
> takes a long time.Can someone tell me what can i change to improve
> it...
>
> def Tkz(tk,data):
> no_
On Tue, 07 Jun 2005 23:38:29 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
>> I don't see a "break" so why the "/2" ? also IIUC the
>
>That was the assumption of an equal distribution of the data. In
>O-notationn this would be O(n) of course.
It was a joke ... the issue is that there was
Diez B. Roggisch wrote:
> [EMAIL PROTECTED] wrote:
>
>> X-No-Archive: yes
>> Can some one help me improve this block of code...this jus converts the
>> list of data into tokens based on the range it falls into...but it
>> takes a long time.Can someone tell me what can i change to improve
>> it...
> I don't see a "break" so why the "/2" ? also IIUC the
That was the assumption of an equal distribution of the data. In
O-notationn this would be O(n) of course.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 07 Jun 2005 18:13:01 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
>Another optimization im too lazy now would be to do sort of a "tree
>search" of data[i] in rngs - as the ranges are ordered, you could find
>the proper one in log_2(len(rngs)) instead of len(rngs)/2.
I don't see
[EMAIL PROTECTED] wrote:
> Can some one help me improve this block of code...this jus converts the
> list of data into tokens based on the range it falls into...but it
> takes a long time.Can someone tell me what can i change to improve
> it...
>
> def Tkz(tk,data):
> no_of_bins = 10
>
wow i dint know that a single statement like that would make such a
difference. Thanks you very much. that really improves the performance
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
X-No-Archive: yes
Can some one help me improve this block of code...this jus converts the
list of data into tokens based on the range it falls into...but it
takes a long time.Can someone tell me what can i change to improve
it...
if data[i] in xrange(r
X-No-Archive: yes
Can some one help me improve this block of code...this jus converts the
list of data into tokens based on the range it falls into...but it
takes a long time.Can someone tell me what can i change to improve
it...
def Tkz(tk,data):
no_of_bins = 10
tkns = []
dmax = ma