On 14/08/2012 16:05, Alister wrote:
On Tue, 14 Aug 2012 12:33:20 +0100, Mark Lawrence wrote:
On 14/08/2012 03:54, Steven D'Aprano wrote:
On Mon, 13 Aug 2012 18:07:26 +0100, Mark Lawrence wrote:
On 13/08/2012 17:14, alex23 wrote:
On Aug 13, 10:37 pm, Mark Lawrence wrote:
Why on your say so
On Tue, 14 Aug 2012 12:33:20 +0100, Mark Lawrence wrote:
> On 14/08/2012 03:54, Steven D'Aprano wrote:
>> On Mon, 13 Aug 2012 18:07:26 +0100, Mark Lawrence wrote:
>>
>>> On 13/08/2012 17:14, alex23 wrote:
On Aug 13, 10:37 pm, Mark Lawrence wrote:
> Why on your say so?
My mistak
On 14/08/2012 03:54, Steven D'Aprano wrote:
On Mon, 13 Aug 2012 18:07:26 +0100, Mark Lawrence wrote:
On 13/08/2012 17:14, alex23 wrote:
On Aug 13, 10:37 pm, Mark Lawrence wrote:
Why on your say so?
My mistake, I didn't realise you wanted to sound so tedious. Knock
yourself out.
Yes m'l
On Mon, 13 Aug 2012 18:07:26 +0100, Mark Lawrence wrote:
> On 13/08/2012 17:14, alex23 wrote:
>> On Aug 13, 10:37 pm, Mark Lawrence wrote:
>>> Why on your say so?
>>
>> My mistake, I didn't realise you wanted to sound so tedious. Knock
>> yourself out.
>>
>>
>>
> Yes m'lud. Do I lick your boots
On Aug 14, 3:43 am, Mark Lawrence wrote:
> On 13/08/2012 01:15, alex23 wrote:
>
> > On Aug 10, 7:37 pm, Mark Lawrence wrote:
> >> Well whatever you do *DON'T* mention Cython. I mentioned it just now but
> >> I think I've got away with it.
>
> > While I'm not against threads straying off topic, yo
On 13/08/2012 01:15, alex23 wrote:
On Aug 10, 7:37 pm, Mark Lawrence wrote:
Well whatever you do *DON'T* mention Cython. I mentioned it just now but
I think I've got away with it.
While I'm not against threads straying off topic, you're beginning to
come across as a bit of an asshole now.
Ju
On 13/08/2012 17:14, alex23 wrote:
On Aug 13, 10:37 pm, Mark Lawrence wrote:
Why on your say so?
My mistake, I didn't realise you wanted to sound so tedious. Knock
yourself out.
Yes m'lud. Do I lick your boots or polish them?
--
Cheers.
Mark Lawrence.
--
http://mail.python.org/mailman
On Aug 13, 1:05 pm, Steven D'Aprano wrote:
>
> Chill out Alex, it's all good. Mark was channelling a famous scene from
> "Fawlty Towers", staring Monty Python's own John Cleese, hence it is on-
> topic, for the sillier definitions of on-topic.
Ha! Thanks for that connection.
Watched and enjoyed F
On Aug 13, 6:05 pm, Steven D'Aprano wrote:
> Chill out Alex, it's all good. Mark was channelling a famous scene from
> "Fawlty Towers", staring Monty Python's own John Cleese, hence it is on-
> topic, for the sillier definitions of on-topic.
Thank you, yes, I get that. However, Mark has repeatedl
On Aug 13, 10:37 pm, Mark Lawrence wrote:
> Why on your say so?
My mistake, I didn't realise you wanted to sound so tedious. Knock
yourself out.
--
http://mail.python.org/mailman/listinfo/python-list
On 13/08/2012 01:15, alex23 wrote:
On Aug 10, 7:37 pm, Mark Lawrence wrote:
Well whatever you do *DON'T* mention Cython. I mentioned it just now but
I think I've got away with it.
While I'm not against threads straying off topic, you're beginning to
come across as a bit of an asshole now.
Ju
On Sun, 12 Aug 2012 17:15:12 -0700, alex23 wrote:
> On Aug 10, 7:37 pm, Mark Lawrence wrote:
>> Well whatever you do *DON'T* mention Cython. I mentioned it just now
>> but I think I've got away with it.
>
> While I'm not against threads straying off topic, you're beginning to
> come across as a
On Aug 10, 7:37 pm, Mark Lawrence wrote:
> Well whatever you do *DON'T* mention Cython. I mentioned it just now but
> I think I've got away with it.
While I'm not against threads straying off topic, you're beginning to
come across as a bit of an asshole now.
Just let it go.
--
http://mail.pytho
Steven D'Aprano於 2012年8月11日星期六UTC+8下午7時26分37秒寫道:
> On Fri, 10 Aug 2012 08:53:43 +1000, Chris Angelico wrote:
>
>
>
> > On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel wrote:
>
> >> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
>
> >>> O(n) for all other entries in the dict which suffer a hash coll
On Fri, 10 Aug 2012 08:53:43 +1000, Chris Angelico wrote:
> On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel wrote:
>> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
>>> O(n) for all other entries in the dict which suffer a hash collision
>>> with the searched entry.
>>>
>>> True, a sensible choice of h
Dave Angel於 2012年8月10日星期五UTC+8上午5時47分45秒寫道:
> On 08/09/2012 05:34 PM, Roman Vashkevich wrote:
>
> > Actually, they are different.
>
> > Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
> > thousand entries, and you will feel the difference.
>
> > Dict uses hashing to get a
On 10/08/2012 13:29, Roy Smith wrote:
In article ,
Mark Lawrence wrote:
On 10/08/2012 09:54, Steven D'Aprano wrote:
On Thu, 09 Aug 2012 19:16:58 -0500, Tim Chase wrote:
On 08/09/12 18:33, Mark Lawrence wrote:
On 10/08/2012 00:24, Roy Smith wrote:
... you mean, Python lets you make a has
In article ,
Mark Lawrence wrote:
> On 10/08/2012 09:54, Steven D'Aprano wrote:
> > On Thu, 09 Aug 2012 19:16:58 -0500, Tim Chase wrote:
> >
> >> On 08/09/12 18:33, Mark Lawrence wrote:
> >>> On 10/08/2012 00:24, Roy Smith wrote:
> > ... you mean, Python lets you make a hash of it?
>
>
On 10/08/2012 09:54, Steven D'Aprano wrote:
On Thu, 09 Aug 2012 19:16:58 -0500, Tim Chase wrote:
On 08/09/12 18:33, Mark Lawrence wrote:
On 10/08/2012 00:24, Roy Smith wrote:
... you mean, Python lets you make a hash of it?
Only if you order it with spam, spam, spam, spam, spam, spam, and
s
On Thu, 09 Aug 2012 19:16:58 -0500, Tim Chase wrote:
> On 08/09/12 18:33, Mark Lawrence wrote:
>> On 10/08/2012 00:24, Roy Smith wrote:
... you mean, Python lets you make a hash of it?
>>>
>>> Only if you order it with spam, spam, spam, spam, spam, spam, and
>>> spam.
>>
>> Now now gentlemen
Andrew Cooper於 2012年8月10日星期五UTC+8上午6時03分26秒寫道:
> On 09/08/2012 22:34, Roman Vashkevich wrote:
>
> > Actually, they are different.
>
> > Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
> > thousand entries, and you will feel the difference.
>
> > Dict uses hashing to get a
On Fri, Aug 10, 2012 at 10:16 AM, Tim Chase
wrote:
> We apologise for the off-topicness in the thread. Those responsible
> have been sacked...
So if you take every mapping variable in your program and name them
"dFoo", "dBar", "dQuux", etc, for "dict"... would that be a dirty
Hungarian dictionar
On 08/09/2012 08:16 PM, Tim Chase wrote:
> On 08/09/12 18:33, Mark Lawrence wrote:
>> On 10/08/2012 00:24, Roy Smith wrote:
... you mean, Python lets you make a hash of it?
>>> Only if you order it with spam, spam, spam, spam, spam, spam, and spam.
>> Now now gentlemen we're getting slightly o
On 08/09/12 18:33, Mark Lawrence wrote:
> On 10/08/2012 00:24, Roy Smith wrote:
>>> ... you mean, Python lets you make a hash of it?
>>
>> Only if you order it with spam, spam, spam, spam, spam, spam, and spam.
>
> Now now gentlemen we're getting slightly off topic here and wouldn't
> want to ups
On Aug 10, 2012 12:34 AM, "Giuseppe Amatulli"
wrote:
>
> Ciao,
> is 12 minutes for 5000x5000 pixel image. half of the time is for
> reading the arrays.
> and the other half for making the loop.
> I will try again to incorporate the mask action in the loop
> and
> read the image line by line.
> Tha
On 08/09/2012 06:53 PM, Chris Angelico wrote:
> On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel wrote:
>> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
>>> O(n) for all other entries in the dict which suffer a hash collision
>>> with the searched entry.
>>>
>>> True, a sensible choice of hash function
On 08/09/2012 06:54 PM, Andrew Cooper wrote:
> On 09/08/2012 23:26, Dave Angel wrote:
>> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
>>> On 09/08/2012 22:34, Roman Vashkevich wrote:
Actually, they are different.
Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
On 10/08/2012 00:24, Roy Smith wrote:
In article ,
Chris Angelico wrote:
On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith wrote:
Python assumes you are a consenting adult. If you wish to engage in
activities which are hazardous to your health, so be it.
... you mean, Python lets you make a ha
In article ,
Chris Angelico wrote:
> On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith wrote:
> > Python assumes you are a consenting adult. If you wish to engage in
> > activities which are hazardous to your health, so be it.
>
> ... you mean, Python lets you make a hash of it?
>
Only if you orde
On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith wrote:
> Python assumes you are a consenting adult. If you wish to engage in
> activities which are hazardous to your health, so be it.
... you mean, Python lets you make a hash of it?
*ducks for cover*
ChrisA
--
http://mail.python.org/mailman/listin
> What do you think? is there a way to speed up the process?
> Thanks
> Giuseppe
Which part is slow? How slow is it?
A simple test to find the slow part of your code is to print messages
between the commands so that you can see how long it takes between each
message.
Oscar.
--
http://mail.pytho
In article ,
Andrew Cooper wrote:
> As for poor implementations,
>
> class Foo(object):
> def __hash__(self):
> return 0
>
> I seriously found that in some older code I had the misfortune of
> reading.
Python assumes you are a consenting adult. If you wish to engage in
activitie
On Fri, Aug 10, 2012 at 8:39 AM, Tim Chase
wrote:
> On 08/09/12 17:26, Dave Angel wrote:
>> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
>> I'm glad you're wrong for CPython's dictionaries. The only time the
>> lookup would degenerate to O[n] would be if the hash table had only one
>> slot. CPyt
On 09/08/2012 23:26, Dave Angel wrote:
> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
>> On 09/08/2012 22:34, Roman Vashkevich wrote:
>>> Actually, they are different.
>>> Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
>>> thousand entries, and you will feel the difference.
On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel wrote:
> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
>> O(n) for all other entries in the dict which suffer a hash collision
>> with the searched entry.
>>
>> True, a sensible choice of hash function will reduce n to 1 in common
>> cases, but it becomes
On Thu, Aug 9, 2012 at 3:26 PM, Dave Angel wrote:
> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
>> On 09/08/2012 22:34, Roman Vashkevich wrote:
>>> Actually, they are different.
>>> Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
>>> thousand entries, and you will feel the
On 08/09/12 17:26, Dave Angel wrote:
> On 08/09/2012 06:03 PM, Andrew Cooper wrote:
> I'm glad you're wrong for CPython's dictionaries. The only time the
> lookup would degenerate to O[n] would be if the hash table had only one
> slot. CPython sensibly increases the hash table size when it become
On 08/09/2012 06:03 PM, Andrew Cooper wrote:
> On 09/08/2012 22:34, Roman Vashkevich wrote:
>> Actually, they are different.
>> Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
>> thousand entries, and you will feel the difference.
>> Dict uses hashing to get a value from the
On 09/08/2012 22:34, Roman Vashkevich wrote:
> Actually, they are different.
> Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
> thousand entries, and you will feel the difference.
> Dict uses hashing to get a value from the dict and this is why it's O(1).
>
Sligtly off top
10.08.2012, в 1:47, Dave Angel написал(а):
> On 08/09/2012 05:34 PM, Roman Vashkevich wrote:
>> Actually, they are different.
>> Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
>> thousand entries, and you will feel the difference.
>> Dict uses hashing to get a value from th
Thanks a lot for the clarification.
Actually my problem is giving to raster dataset in geo-tif format find out
unique pair combination, count the number of observation
unique combination in rast1, count the number of observation
unique combination in rast2, count the number of observation
I try di
On Thu, Aug 9, 2012 at 2:34 PM, Roman Vashkevich wrote:
>
> Actually, they are different.
> Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
> thousand entries, and you will feel the difference.
> Dict uses hashing to get a value from the dict and this is why it's O(1).
>
Us
I realized, I should have done 10, 100, 1000 rather than 1, 10, 100
for better results, so here are the results for 1000 items. It still
maintains the same pattern:
>>> timeit.timeit('for i in d: pass', 'd=dict.fromkeys(range(1000))')
10.166595947685153
>>> timeit.timeit('for i in d.iteritems(): p
On 08/09/2012 05:34 PM, Roman Vashkevich wrote:
> Actually, they are different.
> Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred
> thousand entries, and you will feel the difference.
> Dict uses hashing to get a value from the dict and this is why it's O(1).
Sure, that's wh
On 8/9/2012 5:21 PM, Tim Chase wrote:
On 08/09/12 15:41, Roman Vashkevich wrote:
10.08.2012, в 0:35, Tim Chase написал(а):
On 08/09/12 15:22, Roman Vashkevich wrote:
{(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}
and i want to print to a file without the brackets comas and semicolon i
Actually, they are different.
Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand
entries, and you will feel the difference.
Dict uses hashing to get a value from the dict and this is why it's O(1).
10.08.2012, в 1:21, Tim Chase написал(а):
> On 08/09/12 15:41, Roman V
On 08/09/12 15:41, Roman Vashkevich wrote:
> 10.08.2012, в 0:35, Tim Chase написал(а):
>> On 08/09/12 15:22, Roman Vashkevich wrote:
{(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}
and i want to print to a file without the brackets comas and semicolon in
order to obtain some
On 09/08/2012 21:41, Roman Vashkevich wrote:
dict.items() is a list - linear access time whereas with 'for key in dict:'
access time is constant:
http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#use-in-where-possible-1
10.08.2012, в 0:35, Tim Chase написал(а):
On 08/09/1
dict.items() is a list - linear access time whereas with 'for key in dict:'
access time is constant:
http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#use-in-where-possible-1
10.08.2012, в 0:35, Tim Chase написал(а):
> On 08/09/12 15:22, Roman Vashkevich wrote:
>>> {(4, 5):
On 08/09/2012 10:11 PM, giuseppe.amatu...@gmail.com wrote:
Hi,
I have a dict() unique
like this
{(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}
and i want to print to a file without the brackets comas and semicolon in order
to obtain something like this?
4 5 1
5 4 1
4 4 2
2 3 1
4 3 2
Any
thanks for the fast replies
my testing were very closed to yours but i did not know how to print
the the number after the semicolon!
thanks!
On 9 August 2012 15:25, Oscar Benjamin wrote:
>
> On Aug 9, 2012 9:17 PM, wrote:
>>
>> Hi,
>> I have a dict() unique
>> like this
>> {(4, 5): 1, (5, 4): 1
thanks for the fast replies
my testing were very closed to yours but i did not know how
On 9 August 2012 15:25, Oscar Benjamin wrote:
>
> On Aug 9, 2012 9:17 PM, wrote:
>>
>> Hi,
>> I have a dict() unique
>> like this
>> {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}
>> and i want to pr
On 08/09/12 15:22, Roman Vashkevich wrote:
>> {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}
>> and i want to print to a file without the brackets comas and semicolon in
>> order to obtain something like this?
>> 4 5 1
>> 5 4 1
>> 4 4 2
>> 2 3 1
>> 4 3 2
>
> for key in dict:
> prin
On Aug 9, 2012 9:17 PM, wrote:
>
> Hi,
> I have a dict() unique
> like this
> {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}
> and i want to print to a file without the brackets comas and semicolon in
order to obtain something like this?
> 4 5 1
> 5 4 1
> 4 4 2
> 2 3 1
> 4 3 2
> Any ideas
for key in dict:
print key[0], key[1], dict[key]
10.08.2012, в 0:11, giuseppe.amatu...@gmail.com написал(а):
> Hi,
> I have a dict() unique
> like this
> {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}
> and i want to print to a file without the brackets comas and semicolon in
> ord
Hi,
I have a dict() unique
like this
{(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}
and i want to print to a file without the brackets comas and semicolon in order
to obtain something like this?
4 5 1
5 4 1
4 4 2
2 3 1
4 3 2
Any ideas?
Thanks in advance
Giuseppe
--
http://mail.python.o
56 matches
Mail list logo