Re: Computing correlations with SciPy

2006-03-16 Thread Felipe Almeida Lessa
Em Qui, 2006-03-16 às 07:49 -0800, [EMAIL PROTECTED] escreveu: > I want to compute the correlation between two sequences X and Y, and > tried using SciPy to do so without success.l Here's what I have, how > can I correct it? $ python2.4 Python 2.4.2 (#2, Nov 20 2005, 17:04:48) [GCC 4.0.3 2005

Computing correlations with SciPy

2006-03-16 Thread tkpmep
I want to compute the correlation between two sequences X and Y, and tried using SciPy to do so without success.l Here's what I have, how can I correct it? >>> X = [1, 2, 3, 4, 5] >>> Y = [5, 4, 3, 2, 1] >>> import scipy >>> scipy.corrcoef(X,Y) Traceback (most recent call last): File "", line 1,

Re: bisect and Queue modules in Python 2.4

2006-03-16 Thread Abdullah Yoldas
I had a similar problem when i was using asynchat.fifo, it had a list in the past now it has a deque. So in order to put something to zeroth location (to be compatible with python 2.3 and python 2.4) I did something like: class fifo(asynchat.fifo):     def __init__(self, list=None):    asynch

Re: bisect and Queue modules in Python 2.4

2006-03-16 Thread Alex Martelli
Peter Otten <[EMAIL PROTECTED]> wrote: > SA Trygubenko wrote: > > > q.queue used to be a list, and now it is something else? > > > > I was using bisect module to implement min priority queue, as described > > in python library reference (see > > http://www.python.org/doc/2.3.5/lib/bisect-example

Re: A Frame-space syntax ? - Re: global, globals(), _global ?

2006-03-16 Thread Alex Martelli
robert <[EMAIL PROTECTED]> wrote: ... > > Not sure I entirely understand what you're proposing, but locals access > > must remain compile-time-optimized for crucial practical reasons, so > > "writing to locals()" just will not work right. > > Why will a definite write to _certain_ top local dic

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-16 Thread Steve Juranich
[EMAIL PROTECTED] wrote: > This "release" is as alpha as alpha gets. It's so alpha it > actually loops back around to zeta -- but it's a start, and I > think it's exactly what the Python community needs. Not to pick nits, but that should actually be "... so alpha that it actually loops back aroun

Re: Python Documentation Standards

2006-03-16 Thread Steven Bethard
Colin J. Williams wrote: > Doc strings provide us with a great opportunity to illuminate our code. > > In the example below, __init__ refers us to the class's documentation, > but the class doc doesn't help much. It doesn't? >>> print list.__doc__ list() -> new list list(sequence) -> new list i

Re: Python Debugger / IDE ??

2006-03-16 Thread Don Taylor
Christoph Zwerschke wrote: > [EMAIL PROTECTED] wrote: > >>I like the Pyscripter, is there any Linux version or something of it. > > > Sorry, I forgot to mention that there is a snag in it. Since PyScripter > is based on Python for Delphi, it is available for Windows only. > Is there a free or

Re: int <-> str asymmetric

2006-03-16 Thread Steven Bethard
Schüle Daniel wrote: > however we lack the reverse functionality > the logical > > >>> str(10,2) > Traceback (most recent call last): > File "", line 1, in ? > TypeError: str() takes at most 1 argument (2 given) > >>> > > fails > > it would not break anything if str interface would be change

Re: python debugging question

2006-03-16 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > I am a python newbie. I have writen some 500 lines of code. There are 4 > classes and in all 5 files. > > Now, I am trying to run the program. I am getting wrong values for the > simulation results. If you first write 500 lines of code, and *then* try to run it, it seem

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Tomasz Zielonka
Major correction (missing case): Tomasz Zielonka wrote: > generateMatching :: (Ord a) => Int -> Set a -> [Pat a] -> [[a]] > generateMatching 0 _[]= [[]] generateMatching 0 alphabet (All:ps) = generateMatching 0 alphabet ps > generateMatching 0 _(_:_) = [] Best regards

Python Documentation Standards

2006-03-16 Thread Colin J. Williams
Doc strings provide us with a great opportunity to illuminate our code. In the example below, __init__ refers us to the class's documentation, but the class doc doesn't help much. Are there any guideline which cover such things? PEP 8 has general advice

Re: Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-16 Thread Michael Spencer
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > >> The problem I'm trying to solve is. >> There is a 5x5 grid. >> You need to fit 5 queens on the board such that when placed there are >> three spots left that are not threatened by the queen. > > when you're done with your homework (?), you can

Re: looking for atomixlib

2006-03-16 Thread Rocco
here you'll find it in svn. http://trac.defuze.org/browser/oss -- http://mail.python.org/mailman/listinfo/python-list

Re: can httplib.HTTPConnection use proxy?

2006-03-16 Thread adam
>>> import httplib >>> h = httplib.HTTPConnection("www.google.ca") >>> h.connect() Traceback (most recent call last): File "", line 1, in ? File "C:\Python24\lib\httplib.py", line 627, in connect raise socket.error, msg error: (10061, 'Connection refused') >>> h2 = httplib.HTTPConnection("m

Re: bisect and Queue modules in Python 2.4

2006-03-16 Thread Peter Otten
SA Trygubenko wrote: > q.queue used to be a list, and now it is something else? > > I was using bisect module to implement min priority queue, as described > in python library reference (see > http://www.python.org/doc/2.3.5/lib/bisect-example.html). I have found > out that in Python 2.4 q.queue

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Tomasz Zielonka
Tomasz Zielonka wrote: > putStrLn (concat (intersperse " " ["generateMatching", show a, show > b, show c])) Minor correction: it should be "generateNotMatching". Best regards Tomasz -- I am searching for programmers who are good at least in (Haskell || ML) && (Linux || FreeBSD || math)

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Tomasz Zielonka
[EMAIL PROTECTED] wrote: > The python code below generates a cartesian product subject to any > logical combination of wildcard exclusions. For example, suppose I want > to generate a cartesian product S^n, n>=3, of [a,b,c,d] that excludes > '*a*b*' and '*c*d*a*'. See below for details. > > CHALLEN

bisect and Queue modules in Python 2.4

2006-03-16 Thread SA Trygubenko
Dear All, Python 2.4 (#1, Mar 22 2005, 21:42:42) [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Queue >>> q=Queue.Queue() >>> type(q.queue) >>> q.queue used to be a list, and now it is something else?

Re: can httplib.HTTPConnection use proxy?

2006-03-16 Thread JuHui
sorry, would you please give a sample code? I want to use HTTPConnection to get a html page content via a http proxy. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: asyncore/asynchat do not notify connection errors on Wintel?

2006-03-16 Thread Abdullah Yoldas
Normally when you make a nonblocking connect, socket gets EINPROGRESS, later the result of this request will appear after select returns.   I think asyncore/asynchat incorrectly interprets asychronous connects. Reading Steven's book, I did some modifications to asyncore.dispatcher and asynchat.asyn

Re: can httplib.HTTPConnection use proxy?

2006-03-16 Thread robert
JuHui wrote: > how to use httplib.HTTPConnection with http proxy? > simply connect to the proxy? - and ask using the full url and original Host: - for HTTPS do a CONNECT . Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Tim Parkin
Terry Hancock wrote: > On Tue, 14 Mar 2006 13:22:09 -0700 > Steven Bethard <[EMAIL PROTECTED]> wrote: > >>A.M. Kuchling wrote: >> >>>On Sun, 12 Mar 2006 10:25:19 +0100, >>> Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>> and while you're at it, change "python-dev" to >>> >>>"developers" and

Re: MS word document generator

2006-03-16 Thread paron
You might also consider OpenOffice, which writes to ODF. That way, you're working to a standard. You can script OpenOffice in Python (http://udk.openoffice.org/python/python-bridge.html) . OpenOffice can save in .doc, and does a pretty good job of making a file that most MS Word versions will rende

A Frame-space syntax ? - Re: global, globals(), _global ?

2006-03-16 Thread robert
Alex Martelli wrote: > robert <[EMAIL PROTECTED]> wrote: >... >>I think its good to leave the default global binding (that is probably >>whats Guido doesn't want to give up for good reason) > > > Then, on the principle that there should be preferably only one obvious > way to do something, w

Re: MS word document generator

2006-03-16 Thread M�ta-MCI
Hi! Yes, I have an idea. But... I has no time, actually. Perhaps in 2 or 3 weeks... Sorry. Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Python compiler

2006-03-16 Thread M�ta-MCI
Hi! Bonjour ! Après, vous pourrez aussi fréquenter le newsgroup : fr.comp.lang.python qui a l'avantage d'être en français. à bientôt. Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

int <-> str asymmetric

2006-03-16 Thread Schüle Daniel
Hello what I sometimes miss in Python is the possibility to switch tha base of a number for example this is how it's done in Ruby irb(main):099:0* a = 10.to_s(2) => "1010" irb(main):100:0> a.to_i(2) => 10 irb(main):101:0> irb(main):102:0* a = 10.to_s(3) => "101" irb(main):103:0> a.to_i(3) => 10

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-16 Thread Terry Hancock
On Wed, 15 Mar 2006 23:10:16 +0100 "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > > >> Yes, I'm trying to make time to look at the docutils > >code and the > pydoc command to see what's involved. > >Unfortunately, my spare > time is vanish

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Terry Hancock
On Tue, 14 Mar 2006 13:22:09 -0700 Steven Bethard <[EMAIL PROTECTED]> wrote: > A.M. Kuchling wrote: > > On Sun, 12 Mar 2006 10:25:19 +0100, > > Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >> and while you're at it, change "python-dev" to > >"developers" and > "psf" to "foundation" (or use a tit

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Terry Hancock
On Sun, 12 Mar 2006 11:58:05 -0500 "Peter Decker" <[EMAIL PROTECTED]> wrote: > Of course, you're straying so far from the original > thought behind this thread, and that is that the Python > website is using some terms differently than the majority > of people who will eventually use the site would

Re: Is it better to use class variables or pass parameters?

2006-03-16 Thread Terry Hancock
On 15 Mar 2006 15:04:19 -0800 "Derek Basch" <[EMAIL PROTECTED]> wrote: > > class PeptideEvaluator: > > def evaluate(self, peptide): > [...] > > So, you instantiate a class called "PeptideEvaluator" and > pass in each string to its "evaluate" method. Now you have > to repeatedly pass the pept

Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread [EMAIL PROTECTED]
The python code below generates a cartesian product subject to any logical combination of wildcard exclusions. For example, suppose I want to generate a cartesian product S^n, n>=3, of [a,b,c,d] that excludes '*a*b*' and '*c*d*a*'. See below for details. CHALLENGE: generate an equivalent in ruby,

Re: mod_python installation

2006-03-16 Thread Kai Schulte
The Debian stable package tree has only libapache2-mod-python2.3 (3.1.3-3). You can look at http://packages.debian.org/stable/python/ for a detailed list. If you really want to use python2.4 you can either try to use the ubuntu package (http://packages.ubuntu.org.cn/breezy/python/libapache2-mo

Re: Install Universal Encoding Detector

2006-03-16 Thread Kent Johnson
Jacob wrote: > How do I uninstall? Delete the chardet folder from site-packages (Python24\Lib\site-packages on Windows, not sure of the exact path on other OS's). Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: recycling internationalized garbage

2006-03-16 Thread Fredrik Lundh
"Martin v. Löwis" wrote: >> It should be obvious that any 8-bit single-byte character set can >> produce byte sequences that are valid in UTF-8. > > It is certainly possible to interpret UTF-8 data as if they were > in a specific single-byte encoding. However, the text you then > obtain is not mea

Re: Other languages for PVM

2006-03-16 Thread Diez B. Roggisch
Ravi Teja wrote: > Yes! But not many. > > http://www.livelogix.net/logix/ Interesting. > > Logix also allows you to create your own custom languages for Python's > VM. But for some reason, there does not seem to be much interest in > it's development. Odd, given that it has great potential. I

Re: comparing huge files

2006-03-16 Thread s99999999s2003
thanks for the reply, I have used another method to solve my problem. ie 1) get the total count of the first file 2) write this total count to basecnt eg basecnt 3) get another file, get the total count of this file. eg filecnt 4) if filecnt > basecnt, read in the values from file[basecnt:filecnt]

Re: Python Debugger / IDE ??

2006-03-16 Thread Ritesh Raj Sarraf
Can you please point some good documents (need not be Python specific) on best practices with writing code this way ? Thanks, Ritesh -- http://mail.python.org/mailman/listinfo/python-list

Re: Install Universal Encoding Detector

2006-03-16 Thread Jacob
How do I uninstall? /Jacob -- http://mail.python.org/mailman/listinfo/python-list

Re: Button and Key Event

2006-03-16 Thread lux
Thanks, I think that the solution for my problem is only to use an AcceleratorTable. In this way I can capture the key pressed event without the "button problem" Luca -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing PySQLite on OS X 10.4

2006-03-16 Thread Rob Cowie
Cheers. I should have read the installation notes more carefully :) Rob C -- http://mail.python.org/mailman/listinfo/python-list

Re: Printable string for 'self'

2006-03-16 Thread Duncan Booth
Michael Tobis wrote: > I got in some trouble in these parts a few months back for advocating > some sort of immutable reference, like > > fred -> C("fred") > > where any reassignment of the refernce during the lifetime of the > referent would raise an exception. This seems to be seen as wronghea

Re: Is it better to use class variables or pass parameters?

2006-03-16 Thread Steve Holden
Derek Basch wrote: > So, if I am understanding what everyone is saying here. I should do my > best to distinguish between values that are part of the "state" of an > object and values that are more disposable and can change for each > computation of a value. So if I create an instance of a "wallet"

asyncore/asynchat do not notify connection errors on Wintel?

2006-03-16 Thread Z. Kotzer
I can not get error notifications when an asynchat based client tries to connect to a non-responsive address. To validate the problem I changed lib/test/test_asynchat.py as follows: class echo_client(asynchat.async_chat): def __init__(self): asynchat.async_chat.__init__(self)

can httplib.HTTPConnection use proxy?

2006-03-16 Thread JuHui
how to use httplib.HTTPConnection with http proxy? -- http://mail.python.org/mailman/listinfo/python-list

can httplib.HTTPConnection use proxy?

2006-03-16 Thread JuHui
how to use httplib.HTTPConnection with http proxy? -- http://mail.python.org/mailman/listinfo/python-list

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-16 Thread Nick Craig-Wood
Jason Earl <[EMAIL PROTECTED]> wrote: > Why don't you instead install the info version of the Python > documentation on your server. Then you can do "info Python2.3-lib" > and have at it. I didn't know about that. Its very good. Its still not all the documentation for all the installed modul

Re: Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-16 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The problem I'm trying to solve is. > There is a 5x5 grid. > You need to fit 5 queens on the board such that when placed there are > three spots left that are not threatened by the queen. when you're done with your homework (?), you can compare it with Guido's solution:

Re: Is it better to use class variables or pass parameters?

2006-03-16 Thread Eric Brunel
On 15 Mar 2006 15:04:19 -0800, Derek Basch <[EMAIL PROTECTED]> wrote: > One more question everybody. Say you have a class that performs a > series of evaluations on several strings of peptides. Errr..., no? A class does not perform some operations. A class is a template for objects. What are yo

Re: Markov process representation

2006-03-16 Thread Max M
Jack Diederich wrote: > On Wed, Mar 15, 2006 at 04:50:31PM -0800, Paul Rubin wrote: > >>"kpp9c" <[EMAIL PROTECTED]> writes: >> >>>self._all_states |= set(key[i] for key in probabilities) >>>I am running: >>>Python 2.3 (#1, Sep 13 2003, 00:49:11) >> >>generator comprehensions are new in 2.4. T

<    1   2