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 breamore...@yahoo.co.uk wrote:
Why on your say so?
My mistake, I didn't realise you wanted to sound so tedious. Knock
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 breamore...@yahoo.co.uk wrote:
Why on your say so?
My
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 breamore...@yahoo.co.uk
On Sun, 12 Aug 2012 17:15:12 -0700, alex23 wrote:
On Aug 10, 7:37 pm, Mark Lawrence breamore...@yahoo.co.uk 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
On 13/08/2012 01:15, alex23 wrote:
On Aug 10, 7:37 pm, Mark Lawrence breamore...@yahoo.co.uk 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 13, 10:37 pm, Mark Lawrence breamore...@yahoo.co.uk 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 Aug 13, 6:05 pm, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info 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
On Aug 13, 1:05 pm, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info 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
On 13/08/2012 17:14, alex23 wrote:
On Aug 13, 10:37 pm, Mark Lawrence breamore...@yahoo.co.uk 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.
--
On 13/08/2012 01:15, alex23 wrote:
On Aug 10, 7:37 pm, Mark Lawrence breamore...@yahoo.co.uk 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 14, 3:43 am, Mark Lawrence breamore...@yahoo.co.uk wrote:
On 13/08/2012 01:15, alex23 wrote:
On Aug 10, 7:37 pm, Mark Lawrence breamore...@yahoo.co.uk 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
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 breamore...@yahoo.co.uk 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
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 d...@davea.name wrote:
On 08/09/2012 06:03 PM, Andrew Cooper wrote:
O(n) for all other entries in the dict which suffer a hash
On Aug 10, 7:37 pm, Mark Lawrence breamore...@yahoo.co.uk 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.
On Fri, 10 Aug 2012 08:53:43 +1000, Chris Angelico wrote:
On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel d...@davea.name 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
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 we're getting
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
In article mailman.3147.1344591354.4697.python-l...@python.org,
Mark Lawrence breamore...@yahoo.co.uk 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:
On 10/08/2012 13:29, Roy Smith wrote:
In article mailman.3147.1344591354.4697.python-l...@python.org,
Mark Lawrence breamore...@yahoo.co.uk 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
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 value from
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
--
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
order to
On Aug 9, 2012 9:17 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
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:
print key[0], key[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 oscar.j.benja...@gmail.com wrote:
On Aug 9, 2012 9:17 PM, giuseppe.amatu...@gmail.com wrote:
Hi,
I have a dict() unique
like this
{(4, 5): 1, (5, 4): 1, (4, 4): 2,
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 oscar.j.benja...@gmail.com wrote:
On Aug 9, 2012 9:17 PM, giuseppe.amatu...@gmail.com wrote:
Hi,
I have a
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
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): 1,
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
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 something like
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
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
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 why
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(): pass',
On Thu, Aug 9, 2012 at 2:34 PM, Roman Vashkevich vashkevic...@gmail.com 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
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
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 the dict
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 topic,
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 dict and
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 becomes
On Thu, Aug 9, 2012 at 3:26 PM, Dave Angel d...@davea.name 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
On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel d...@davea.name 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
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.
Dict uses
On Fri, Aug 10, 2012 at 8:39 AM, Tim Chase
python.l...@tim.thechases.com 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
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.
--
In article ucXUr.1030527$2z2.380746@fx19.am4,
Andrew Cooper am...@cam.ac.uk 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
On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith r...@panix.com 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
--
In article mailman.3135.1344554073.4697.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith r...@panix.com wrote:
Python assumes you are a consenting adult. If you wish to engage in
activities which are hazardous to your health, so be
On 10/08/2012 00:24, Roy Smith wrote:
In article mailman.3135.1344554073.4697.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith r...@panix.com wrote:
Python assumes you are a consenting adult. If you wish to engage in
activities which
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
thousand entries,
On 08/09/2012 06:53 PM, Chris Angelico wrote:
On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel d...@davea.name 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 Aug 10, 2012 12:34 AM, Giuseppe Amatulli giuseppe.amatu...@gmail.com
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
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 upset the
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 off topic
On Fri, Aug 10, 2012 at 10:16 AM, Tim Chase
python.l...@tim.thechases.com 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
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 value from
56 matches
Mail list logo