Re: Negative array indicies and slice()

2012-10-31 Thread Andrew Robinson
On 10/30/2012 10:29 PM, Michael Torrie wrote: As this is the case, why this long discussion? If you are arguing for a change in Python to make it compatible with what this fork you are going to create will do, this has already been fairly thoroughly addressed earl on, and reasons why the semant

Re: Negative array indicies and slice()

2012-10-31 Thread Ian Kelly
On Tue, Oct 30, 2012 at 4:25 PM, Andrew Robinson wrote: > Ian, > >> Looks like it's already been wontfixed back in 2006: > >> http://bugs.python.org/issue1501180 > > Absolutely bloody typical, turned down because of an idiot. Who the hell is > Tim Peters anyway? > >> I don't really disagree with

Re: calling one staticmethod from another

2012-10-31 Thread Ulrich Eckhardt
Am 30.10.2012 18:23, schrieb Jean-Michel Pichavant: - Original Message - [snip] I haven't figured out the justification for staticmethod, http://en.wikipedia.org/wiki/Namespace + "Namespaces are one honking great idea -- let's do more of those!" Someone may successfully use only modul

Re: Negative array indicies and slice()

2012-10-31 Thread Steven D'Aprano
On Tue, 30 Oct 2012 21:33:32 +, Mark Lawrence wrote: > On 30/10/2012 18:02, Ian Kelly wrote: >> On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman >> wrote: >>> File a bug report? >> >> Looks like it's already been wontfixed back in 2006: >> >> http://bugs.python.org/issue1501180 >> >> > Absolute

working with yml files in python and opencv

2012-10-31 Thread inshu chauhan
How to load a yml file in python and work with it ?? I used : import cv data = cv.Load("Z:/data/xyz_0_300.yml") But when I print data.. it just gives the detail of the image like number of rows and columns etc I want read what is there in the pixel of the image.. can somebody

Re: datetime issue

2012-10-31 Thread Grant Edwards
On 2012-09-16, ?? wrote: > Iam positng via google groups using chrome, thats all i know. Learn something else. Google Groups is seriously and permanently broken, and all posts from Google Groups are filtered out and ignored by many people (including myself -- I only saw this becaus

sort order for strings of digits

2012-10-31 Thread djc
I learn lots of useful things from the list, some not always welcome. No sooner had I found a solution to a minor inconvenience in my code, than a recent thread here drew my attention to the fact that it will not work for python 3. So suggestions please: TODO 2012-10-22: sort order numbers

Re: sort order for strings of digits

2012-10-31 Thread Hans Mulder
On 31/10/12 16:17:14, djc wrote: > Python 3.2.3 (default, Oct 19 2012, 19:53:16) > sorted(n+s) > ['1', '10', '101', '13', '1a', '2', '2000', '222 bb', '3', '31', '40', > 'a', 'a1', 'ab', 'acd', 'b a 4', 'bcd'] > sorted(int(x) if x.isdigit() else x for x in n+s) > Traceback (most recent

Re: sort order for strings of digits

2012-10-31 Thread Ian Kelly
On Wed, Oct 31, 2012 at 9:17 AM, djc wrote: > The best I can think of is to split the input sequence into two lists, sort > each and then join them. In the example you have given they already seem to be split, so you could just do: sorted(n, key=int) + sorted(s) If that's not really the case, t

Re: Float to String

2012-10-31 Thread Mark Dickinson
3ds.com> writes: > When formatting a float using the exponential format, the rounding is > different in Python-2.6 and Python-2.7. See example below. Is this > intentional? Yes, in a sense. Python <= 2.6 uses the OS-provided functionality (e.g., the C library's strtod, dtoa and sprintf functi

Re: Negative array indicies and slice()

2012-10-31 Thread Mark Lawrence
On 31/10/2012 10:07, Steven D'Aprano wrote: On Tue, 30 Oct 2012 21:33:32 +, Mark Lawrence wrote: Absolutely bloody typical, turned down because of an idiot. Who the hell is Tim Peters anyway? :) I see your smiley, but for the benefit of those who actually don't know who Tim Peters, a.k.a

Need 4 Python Developer // Times Sq - New York // 15+ Months Contract.

2012-10-31 Thread raj
Hi Friends, Hope you are doing great. This is Rajesh from NYTP. I wanted to let you know about New Job opening in Times Sq - New York. It is a 15+ months Contract. Role : Python Developer Location : Times Sq - New York Duration : 15+ Months Contract Pos

Re: Obnoxious postings from Google Groups

2012-10-31 Thread rurpy
On 10/30/2012 11:07 PM, Robert Miles wrote:> On 9/16/2012 8:18 AM, Ben Finney wrote: >> Νικόλαος Κούρας writes: >> >>> Iam sorry i didnt do that on purpose and i dont know how this is done. >>> >>> Iam positng via google groups using chrome, thats all i know. >> >> It is becoming quite clear that

Re: datetime issue

2012-10-31 Thread rurpy
On 10/31/2012 09:11 AM, Grant Edwards wrote:> On 2012-09-16, ?? wrote: > >> Iam positng via google groups using chrome, thats all i know. > > Learn something else. Google Groups is seriously and permanently > broken, and all posts from Google Groups are filtered out and ignored >

RE: date and time comparison how to

2012-10-31 Thread Prasad, Ramit
Gary Herron wrote: > On 10/29/2012 04:13 PM, noydb wrote: > > All, > > > > I need help with a date and time comparison. > > > > Say a user enters a date-n-time and a file on disk. I want to compare the > > date and time of the file to the > entered date-n-time; if the file is newer than the enter

Re: Negative array indicies and slice()

2012-10-31 Thread Ian Kelly
On Wed, Oct 31, 2012 at 7:42 AM, Andrew Robinson wrote: > Then; I'd note: The non-goofy purpose of slice is to hold three data > values; They are either numbers or None. These *normally* encountered > values can't create a memory loop. > So, FOR AS LONG, as the object representing slice does no

Re: sort order for strings of digits

2012-10-31 Thread Mark Lawrence
On 31/10/2012 18:17, Dennis Lee Bieber wrote: Why -- I doubt Python 3.x .sort() and sorted() have removed the optional key and cmp keywords. Nope. I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be very dead. This doesn't help either. c:\Users\Mark\Cash\Python>2to3.

Re: datetime issue

2012-10-31 Thread Mark Lawrence
On 31/10/2012 19:35, ru...@yahoo.com wrote: On 10/31/2012 09:11 AM, Grant Edwards wrote:> On 2012-09-16, ?? wrote:. "Broken"? Yes. But so is every piece of software in one way or another. Thunderbird is one of the most perpetually buggy pierces of software I have ever used on a

Re: sort order for strings of digits

2012-10-31 Thread Ian Kelly
On Wed, Oct 31, 2012 at 3:33 PM, Mark Lawrence wrote: > Nope. I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be > very dead. > > This doesn't help either. > > c:\Users\Mark\Cash\Python>**2to3.py > > Traceback (most recent call last): > File "C:\Python33\Tools\Scripts\**2to3.py",

Re: Obnoxious postings from Google Groups

2012-10-31 Thread Steven D'Aprano
On Wed, 31 Oct 2012 12:32:57 -0700, rurpy wrote: [...] >> You're probably referring to their change in the way they handle >> end-of-lines, which is now incompatible with most newsreaders, >> especially with multiple levels of quoting. > > It's a minor pain to fix this when posting, but > > 1. I

Re: sort order for strings of digits

2012-10-31 Thread Steven D'Aprano
On Wed, 31 Oct 2012 15:17:14 +, djc wrote: > The best I can think of is to split the input sequence into two lists, > sort each and then join them. According to your example code, you don't have to split the input because you already have two lists, one filled with numbers and one filled wit

Re: sort order for strings of digits

2012-10-31 Thread Steven D'Aprano
On Wed, 31 Oct 2012 19:05:17 -0400, Dennis Lee Bieber wrote: >> The cmp builtin is also gone. If you need it, the suggested >> replacement for "cmp(a, b)" is "(b < a) - (a < b)". >> > OUCH... Just another reason for my to hang onto the 2.x series as > long as possible On the contrary. If

Re: sort order for strings of digits

2012-10-31 Thread DJC
On 31/10/12 23:09, Steven D'Aprano wrote: On Wed, 31 Oct 2012 15:17:14 +, djc wrote: The best I can think of is to split the input sequence into two lists, sort each and then join them. According to your example code, you don't have to split the input because you already have two lists, o

Re: Obnoxious postings from Google Groups

2012-10-31 Thread Arnaud Delobelle
On 31 October 2012 22:33, Steven D'Aprano wrote: [...] > I don't killfile merely for posting from Gmail And we are humbly grateful. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: datetime issue

2012-10-31 Thread Robert Miles
On 10/31/2012 2:35 PM, ru...@yahoo.com wrote: On 10/31/2012 09:11 AM, Grant Edwards wrote:> On 2012-09-16, ?? wrote: Iam positng via google groups using chrome, thats all i know. Learn something else. Google Groups is seriously and permanently broken, and all posts from Googl

Re: datetime issue

2012-10-31 Thread Robert Miles
On 10/31/2012 4:38 PM, Mark Lawrence wrote: On 31/10/2012 19:35, ru...@yahoo.com wrote: On 10/31/2012 09:11 AM, Grant Edwards wrote:> On 2012-09-16, ?? wrote:. "Broken"? Yes. But so is every piece of software in one way or another. Thunderbird is one of the most perpetually bug

Re: sort order for strings of digits

2012-10-31 Thread Mark Lawrence
On 31/10/2012 22:24, Ian Kelly wrote: On Wed, Oct 31, 2012 at 3:33 PM, Mark Lawrence wrote: Nope. I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be very dead. This doesn't help either. c:\Users\Mark\Cash\Python>**2to3.py Traceback (most recent call last): File "C:\Python33

Re: datetime issue

2012-10-31 Thread Mark Lawrence
On 01/11/2012 00:23, Robert Miles wrote: On 10/31/2012 4:38 PM, Mark Lawrence wrote: On 31/10/2012 19:35, ru...@yahoo.com wrote: On 10/31/2012 09:11 AM, Grant Edwards wrote:> On 2012-09-16, ?? wrote:. "Broken"? Yes. But so is every piece of software in one way or another. Thun

Re: Python garbage collector/memory manager behaving strangely

2012-10-31 Thread Robert Miles
On 9/16/2012 9:12 PM, Dave Angel wrote: On 09/16/2012 09:07 PM, Jadhav, Alok wrote: Hi Everyone, I have a simple program which reads a large file containing few million rows, parses each row (`numpy array`) and converts into an array of doubles (`python array`) and later writes into an `hdf5

Re: sort order for strings of digits

2012-10-31 Thread Chris Angelico
On Thu, Nov 1, 2012 at 10:44 AM, Steven D'Aprano wrote: > On the contrary. If you are using cmp with sort, your sorts are slow, and > you should upgrade to using a key function as soon as possible. > But cmp_to_key doesn't actually improve anything. So I'm not sure how Py3 has achieved anything;

Re: sort order for strings of digits

2012-10-31 Thread Arnaud Delobelle
On 31 October 2012 23:09, Steven D'Aprano wrote: > The trick is to take each string and split it into a leading number and a > trailing alphanumeric string. Either part may be "empty". Here's a pure > Python solution: > > from sys import maxsize # use maxint in Python 2 > def split(s): > for

Re: Negative array indicies and slice()

2012-10-31 Thread Andrew Robinson
On 10/31/2012 02:20 PM, Ian Kelly wrote: On Wed, Oct 31, 2012 at 7:42 AM, Andrew Robinson wrote: Then; I'd note: The non-goofy purpose of slice is to hold three data values; They are either numbers or None. These *normally* encountered values can't create a memory loop. So, FO

how to perform word sense disambiguation?

2012-10-31 Thread nachiket
an initial part of my project involves assigning sense to each word in sentence. I came across this tool called wordnet. do share your views -- http://mail.python.org/mailman/listinfo/python-list