Re: Generator question

2006-11-26 Thread Robert Kern
y iterate over it and yield its values. E.g. In [2]: def test_gen(x): ...: yield x ...: x -= 1 ...: if x != 0: ...: for y in test_gen(x): ...: yield y ...: ...: In [3]: list(test_gen(3)) Out[3]: [3, 2, 1] -- Robert Kern "I have come to

Re: --enable-shared, how do i set the rpath?

2006-11-27 Thread Robert Kern
x27;s. I find that most of my Apache problems stem from incorrect permissions. Make sure that the user running the Apache process has "read" and "execute" permissions for the .so's. -- Robert Kern "I have come to believe that the whole world is an enigma, a harm

Re: splitting a long string into a list

2006-11-27 Thread Robert Kern
want it to - any ideas? Did you follow the recommendations given to you the last time you asked this question? What did you try? What results do you want to get? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad

Re: extremely slow array indexing?

2006-11-30 Thread Robert Kern
e on mine. Changing the last line to "currSum += row" gets a 3x speedup. Dropping the "row[:] = 1" line as it's a really just a time-consuming no-op in the example and probably not an accurate reflection of what's going on in the real code gets you another 2x spe

Re: How do I print a numpy array?

2006-12-01 Thread Robert Kern
y questions on the numpy list: http://www.scipy.org/Mailing_Lists Use numpy.set_printoptions(threshold=sys.maxint) to disable all summarization. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to in

Re: How do I print a numpy array?

2006-12-01 Thread Robert Kern
Grant Edwards wrote: > On 2006-12-01, Robert Kern <[EMAIL PROTECTED]> wrote: >> Grant Edwards wrote: >>> How do you print a numpy array? > >> You might want to ask numpy questions on the numpy list: >> >> http://www.scipy.org/Mailing_Lists >

Re: How do I print a numpy array?

2006-12-01 Thread Robert Kern
nce the interactive prompt prints things out without the user explicitly asking for it, it's not enough simply to have two functions available. numarray set the default to summarize, and numpy kept numarray's choice. -- Robert Kern "I have come to believe that the whole world is an

Re: How do I print a numpy array?

2006-12-01 Thread Robert Kern
Grant Edwards wrote: > On 2006-12-02, Robert Kern <[EMAIL PROTECTED]> wrote: >> Grant Edwards wrote: >>> On 2006-12-01, Robert Kern <[EMAIL PROTECTED]> wrote: >>>> Grant Edwards wrote: >>>>> How do you print a numpy array? >

Re: Why not just show the out-of-range index?

2006-12-03 Thread Robert Kern
ing > to go to defend this omission. It promises to be entertaining. I'm not sure that anybody is going to defend it as a deliberate omission. Rather, they (like I) will encourage to OP to submit a patch that fixes the problem. -- Robert Kern "I have come to believe that the w

Re: Why not just show the out-of-range index?

2006-12-03 Thread Robert Kern
on than posting a patch. They listen to patch submissions much more than comp.lang.python. At the very least, you should submit a bug report even if you don't want to take the opportunity to learn how to fix it yourself. -- Robert Kern "I have come to believe that the whole world is an

Re: problem formatting dates from text fields.

2006-12-03 Thread Robert Kern
#x27;s website: http://www.manning.com/rappin/ If their Yahoo store is not accessible via your web reader (I have no experience, so I won't depend on it), you can email the publisher's customer service at [EMAIL PROTECTED] and I'm sure they will get the book to you in a form you can re

Re: Why not just show the out-of-range index?

2006-12-03 Thread Robert Kern
mention it? No one is castigating the OP for bringing up the issue. His suggestion that his time is worth more than that of anyone else, though, is drawing some ire. Fortunately, he seems to have backed off this position and seems amenable to doing something more productive than posting here. -- Robert

Re: Why not just show the out-of-range index?

2006-12-04 Thread Robert Kern
;ve been pointed to the productive things you can do to resolve the issue that you have: 1. Submit a bug report. 2. Submit a patch. Nothing is going to happen until you do one of these two things. Being more rude (and yes, you are being incredibly rude and insulting) won't move things alo

Re: Why not just show the out-of-range index?

2006-12-04 Thread Robert Kern
Russ wrote: > Robert Kern wrote: > >> Nothing is going to happen until you do one of these two things. Being more >> rude >> (and yes, you are being incredibly rude and insulting) won't move things >> along. > > I re-read the thread, and I don't s

Re: Inheritance doesn't work

2006-12-04 Thread Robert Kern
hon 2.4 from the Debian (Sid) packages. > > Is it a bug, or am I doing something wrong? You're doing something wrong. PIL.Image is a module, not a class. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad att

Re: Why not just show the out-of-range index?

2006-12-04 Thread Robert Kern
if anyone construed my comments as insults. However, facts are facts, and I stated them as I believe them. If you can pick out the precise comments that you felt were insulting, I will be happy to attempt clarifying them in a way that you do not find insulting. -- Robert Kern "I have come to be

Re: Why not just show the out-of-range index?

2006-12-04 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Robert Kern wrote: >> [EMAIL PROTECTED] wrote: >>> I saw no posts where there OP insulted anybody without being >>> insulted first. It is ironic the Mr. Kern was the most consistent >>> insulter while at the same time accusing the OP

Re: Linear regression in NumPy

2006-12-05 Thread Robert Kern
g/Documentation And please join us on numpy-discussion if you have any more questions. http://www.scipy.org/Mailing_Lists -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as thou

Re: advice on stripped down python

2006-12-06 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Will old Python releases, like 1.5.x, work with newer Numpy and Scipy? No. numpy and scipy require 2.3. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it a

Re: Windows installer for Scientific Python for Python 2.4?

2006-12-06 Thread Robert Kern
://sourcesup.cru.fr/projects/scientific-py/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem of understanding inheritance

2006-12-06 Thread Robert Kern
e __add__(). I'm almost certain that the implementation of datetime.date.__add__ creates a new datetime.date object explicitly rather than using self.__class__ to figure out what it should construct. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigm

Re: newb: What is the purpose of if __name__ == "__main__":

2006-12-06 Thread Robert Kern
johnny wrote: > What is the purpose of > if __name__ == "__main__": > > If you have a module, does it get called automatically? http://docs.python.org/lib/module-main.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma t

Re: Sorting Multidimesional array(newbie)

2006-12-12 Thread Robert Kern
15]: from numpy import * In [16]: a = array([[5, 2], [1, 3], [1, 2]]) In [17]: a[lexsort(keys=a.transpose()[::-1])] Out[17]: array([[1, 2], [1, 3], [5, 2]]) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by o

Re: About alternatives to Matlab

2006-12-14 Thread Robert Kern
uot;, line 1, in ? > NameError: name 'ones' is not defined Use the code that Filip wrote: from numpy import ones, arange, reshape, int32 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: speed of python vs matlab.

2006-12-14 Thread Robert Kern
ormance than other > scripting languages. but I'm just surprised that matlab does a great > job compared to python/perl, since matlab is also a interpreted > language, I'm expecting it has silimar performance with python. Matlab uses a JIT compiler along the lines of psyco for sim

Re: first and last index as in matlab

2006-12-17 Thread Robert Kern
matlab? > > If you want functionality similar to Matlab in Python, you should use > Numpy, which has the "take" function to do what you want. Actually, in numpy, we also have "fancy indexing" similar to Matlab's: In [1]: from numpy import * In [2]: ind = arra

Re: python-hosting.com projects: dead?

2006-12-19 Thread Robert Kern
most of the other free Tracs that I could scrounge up through Google. Jason's not just being paranoid. While it may be temporary and he will get hosting back in a few months(!), it's still down, and apparently without warning (I'm not a party to any of this, so I'm simply

Re: Problem in using Pulp

2006-12-21 Thread Robert Kern
le quote and keeps interpreting the rest of the line as a string. Since the line ends before another, unescaped " comes along, it raises the exception that you see. http://docs.python.org/ref/strings.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmles

Re: Problem in using Pulp

2006-12-21 Thread Robert Kern
s escape all of the backslashes (or use raw strings to avoid the escaping altogether). E.g. "C:\\Documents and Settings\\Amit\\Desktop\\glpk-4.9\\glpk-4.9\\examples\\" or r"C:\Documents and Settings\Amit\Desktop\glpk-4.9\gplk-4.9\examples\" -- Robert Kern &

Re: Problem in using Pulp

2006-12-22 Thread Robert Kern
MRAB wrote: > Robert Kern wrote: >> The last character in that string is a double quote. You don't want that. >> What >> you want to do is escape all of the backslashes (or use raw strings to avoid >> the >> escaping altogether). E.g. >> >>

Re: A stupid question

2006-12-28 Thread Robert Kern
m However, none of us know who built your system or any specifics as to what they installed Python for. You should ask them, instead. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpre

Re: Wow, Python much faster than MatLab

2006-12-30 Thread Robert Kern
e doesn't really change anything. However, if type inferencing tools like psyco are taught about numpy arrays like they are already taught about ints, then one could do make it avoid temporaries. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma tha

Re: Unsubscribing from the list

2007-01-02 Thread Robert Kern
bscribe". Follow the instructions in the email that is sent to you. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: Unsubscribing from the list

2007-01-03 Thread Robert Kern
irst time. He misunderstood you (as I nearly did, too). The way you phrased "decided that there was no futher interest on the page for me" is somewhat ambiguous: it can seem like it refers to the second time, not the first. -- Robert Kern "I have come to believe that the whole

Re: Set type?

2007-01-04 Thread Robert Kern
_ wrote: > How do you check to see if a variable is a set? I would like to use > > if type(var) is types.SetType: >blah > > but that is not available in types module. I am using 2.4 In [1627]: type(set()) is set Out[1627]: True -- Robert Kern "I have come to

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Robert Kern
jeremito wrote: > I am writing a class that is intended to be subclassed. What is the > proper way to indicate that a sub class must override a method? raise NotImplementedError -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is ma

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Robert Kern
.python.org/lib/module-exceptions.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: where to find wx package

2007-01-05 Thread Robert Kern
ly name. > > Where can I get the wx package (for win32 XP)? It's the same project (from the people at www.wxpython.org), they just renamed the package. You already have it installed. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma t

Re: PyType_IsSubtype ()

2007-01-05 Thread Robert Kern
ase try to come up with the smallest self-contained snippet of code that demonstrates the bug so that the rest of us can try to replicate it. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it

Re: howto overload with a NOP (empty statement)

2007-01-06 Thread Robert Kern
lasses, but not in all. > Now apparently it's not allowed to overload a method with an empty > statement. > I could write a nonsense dummy statement, like "A= 3", but isn't there > another way ? pass -- Robert Kern "I have come to believe that the whole worl

Re: c# application calling Scipy

2007-01-06 Thread Robert Kern
ython.org distribution of Python with a bunch of packages; it knows nothing about C#. I know little about Python for .NET beyond its README, but it does seem to be able to embed CPython into a C# application and with some elbow grease, that might work for you. -- Robert Kern "I have come to

Re: Module to read svg

2007-01-08 Thread Robert Kern
e fits what the OP is asking for. SVG defines some non-XML structure for some of its contents. For example: The OP is asking for a module that would parse the "points" attribute into a list: [(100.0, 200.0), (100.0, 100.0)] -- Robert Kern "I have come to believe that the

Re: Module to read svg

2007-01-09 Thread Robert Kern
Tim Roberts wrote: > Robert Kern <[EMAIL PROTECTED]> wrote: > >> Martin v. Löwis wrote: >>> [EMAIL PROTECTED] schrieb: >>>> Does anyone know if there's an actual free implementation of this? >>> For the dom module in it, xml.dom.minidom shou

Re: Maths error

2007-01-09 Thread Robert Kern
Bjoern Schliessmann wrote: > Nick Maclaren wrote: > >> No, don't. That is about another matter entirely, > > It isn't. Actually it really is. That thread is about the difference between str(some_float) and repr(some_float) and why str(some_tuple) uses the repr()

Re: distutils and ctypes

2007-01-09 Thread Robert Kern
ist.gov/oof/oof2/source/oof2-2.0.1.tar.gz The code is in the shlib/ subdirectory. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." --

Re: distutils and ctypes

2007-01-09 Thread Robert Kern
Robert Kern wrote: > [EMAIL PROTECTED] wrote: > >> So finally, my question is, is there a way to get distutils to simply >> build a shared library on windows so that I can use ctypes with them??? > > Not out-of-box, no. The OOF2 project has added a bdist_shlib command w

Re: Newbie - converting csv files to arrays in NumPy

2007-01-09 Thread Robert Kern
om_csv(filename, skip_header=True): f = open(filename) try: reader = csv.reader(f) floats = [] if skip_header: reader.next() for row in reader: floats.append(map(float, row)) finally: f.close() return numpy.array(floats) --

Re: distutils and ctypes

2007-01-09 Thread Robert Kern
Martin v. Löwis wrote: > Not sure it's stupid, but I wonder why you want to use ctypes. What's > wrong with extension modules? What's wrong with ctypes? They're both valid, useful approaches to connect to C libraries. -- Robert Kern "I have come to believe that

Re: distutils and ctypes

2007-01-09 Thread Robert Kern
Martin v. Löwis wrote: > Robert Kern schrieb: >>> Not sure it's stupid, but I wonder why you want to use ctypes. What's >>> wrong with extension modules? >> What's wrong with ctypes? They're both valid, useful approaches to connect >> to C &

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-22 Thread Robert Kern
th you on this bug over on the numpy-discussion list. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-23 Thread Robert Kern
Sébastien Boisgérault wrote: > Robert Kern wrote: > >>Sébastien Boisgérault wrote: >> >>>By the way, I tried numpy 0.9.4 10 minutes ago and guess >>>what ? 'eigenvalue' is broken too ... (hangs forever) >> >>On what platform? > >

Re: trying to get hash from os.urandom

2006-01-23 Thread Robert Kern
se) > > If you want to use the phrase as a cryptography key, use 6 or so words > instead of 2 words. Indeed. I like to generate {64,128}-bit-strong passphrases using the RFC1751 module provided with pycrypto. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass

Re: Using non-ascii symbols

2006-01-23 Thread Robert Kern
James Stroud wrote: > I can't find "≤, ≥, or ≠" on my keyboard. Get a better keyboard? or OS? On OS X, ≤ is Alt-, ≥ is Alt-. ≠ is Alt-= Fewer keystrokes than <= or >= or !=. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are

Re: Using non-ascii symbols

2006-01-24 Thread Robert Kern
Rocco Moretti wrote: [James Stroud wrote:] >>>>I can't find "?, ?, or ?" on my keyboard. > > Posting code to newsgroups might get harder too. :-) His post made it through fine. Your newsreader messed it up. -- Robert Kern [EMAIL PROTECTED] "In the fie

Re: Using non-ascii symbols

2006-01-24 Thread Robert Kern
t permitted by applicable law. Last login: Mon Jan 9 12:40:28 2006 from 192.168.1.141 [~]$ cat > utf-8.txt x + y ≥ z [~]$ cat utf-8.txt x + y ≥ z Luck isn't involved. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of

Re: Using non-ascii symbols

2006-01-24 Thread Robert Kern
James Stroud wrote: > Robert Kern wrote: > >>James Stroud wrote: >> >>>I can't find "≤, ≥, or ≠" on my keyboard. >> >>Get a better keyboard? or OS? > > Please talk to my boss. Tell him I want a Quad G5 with about 2 Giga ram. > I&

Re: How do I dynamically create functions without lambda?

2006-01-27 Thread Robert Kern
, Pythonic way. ;-) It doesn't exist, yet. Python 3000 isn't even in planning stages, yet. There are just some loose ideas floating around about what will (and won't!) be in it. You can't write Python 3000 compliant code right now because there is nothing to comply with. --

Re: writing large files quickly

2006-01-27 Thread Robert Kern
rbt wrote: > Hmmm... when I copy the file to a different drive, it takes up > 409,600,000 bytes. Also, an md5 checksum on the generated file and on > copies placed on other drives are the same. It looks like a regular, big > file... I don't get it. google("sparse fi

Re: Data Crunching and Charting....

2006-01-28 Thread Robert Kern
lly cool but has some neg. points: > - documentation is not really detailed and there are really few > examples > - not supported anymore (at least i've never found any place supporting > it.. if anyone know bout any support tell me!!) http://code.enthought.com/chaco/ You're pr

Re: Decoupling the version of the file from the name of the module.

2006-01-29 Thread Robert Kern
name, so that newer > libraries weren't blown away by older ones. > > What is the Python solution? Enquiring minds want to know. http://peak.telecommunity.com/DevCenter/PythonEggs http://peak.telecommunity.com/DevCenter/PkgResources -- Robert Kern [EMAIL PROTECTED] "In the

Re: Python module for LX200 telescope command set

2006-01-29 Thread Robert Kern
RayS wrote: > Whatever happened to the astropy list? http://www.scipy.net/mailman/listinfo/astropy -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mai

Re: determinant

2006-01-30 Thread Robert Kern
l need to know things like your platform, your compiler, and the actual text of the errors that you are seeing. http://lists.sourceforge.net/lists/listinfo/numpy-discussion But once you have it installed: In [29]: A Out[29]: array([[0, 1], [2, 3]]) In [30]: numpy.linalg.det(A) Out[30]: -2

Re: cannot install scipy

2006-02-03 Thread Robert Kern
een that particular error, though. I'd be happy to help you through this on [EMAIL PROTECTED] . We will probably need to see the output of the numpy build. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: cannot install scipy

2006-02-03 Thread Robert Kern
etty ancient version of scipy using the old Numeric, and not the new numpy. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: python's library support

2006-02-03 Thread Robert Kern
module in perl to implement graph > theory. Is there a graph theory module in python? http://networkx.sourceforge.net And several others if you google a bit. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die."

Re: NumPy error

2006-02-05 Thread Robert Kern
df > on page 12. It is different. We're not really sure why. The simplex method is not an algorithm known for its robustness. Sorry about the confusion with dtypechar. Our releases of numpy and scipy got out of sync. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric and matlab

2006-02-05 Thread Robert Kern
3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4. , 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5. ]) > % meshgrid...usually to go through all possibly values of a parameter > > [x,y]=meshgrid(1:10,-5:.1:5) In [28]: x,y = mgrid[1:11, -5:5.1:0.1] -- Robert Kern [EMAI

Re: Scientific Computing with NumPy

2006-02-06 Thread Robert Kern
mclaugb wrote: > Is Scipy the same thing as ScientificPython? > I am confused if SciPy is just the new version. they appear to be separate > things. They are separate projects. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the gr

Re: Scientific Computing with NumPy

2006-02-06 Thread Robert Kern
ipy 0.4+ is ported to numpy (I recommend using an SVN checkout rather than the tarball). -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: importing maple into python

2006-02-09 Thread Robert Kern
walter kehowski wrote: > Hello, > > Is there for a python program to call maple? http://sage.sourceforge.net -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail

Re: Legality of using Fonts

2006-02-10 Thread Robert Kern
ction would > be illegal. Fonts aren't subject copyright, just the hints in most > outline fonts, which are considered computer programs. In the interest of adding some specifics: http://www.faqs.org/faqs/fonts-faq/part2/ -- Robert Kern [EMAIL PROTECTED] "In the fields of he

Re: Scientific Computing with NumPy

2006-02-11 Thread Robert Kern
setup.py install --install-scripts=/usr/local/bin Note: the sudo in that last command is only necessary if your user account does not have write access to /usr/local/bin -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams a

Re: Scientific Computing with NumPy

2006-02-15 Thread Robert Kern
PROTECTED] if you will give us some more information like what arguments you gave to the setup script and the exact error messages that you are seeing. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die.&quo

Re: calculating on matrix indices

2006-02-16 Thread Robert Kern
. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, ... -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: calculating on matrix indices

2006-02-17 Thread Robert Kern
linspace(start, stop, num=50, endpoint=True, retstep=False) Docstring: Return evenly spaced numbers. Return 'num' evenly spaced samples from 'start' to 'stop'. If 'endpoint' is True, the last sample is 'stop'. If 'retstep'

Re: calculating on matrix indices

2006-02-17 Thread Robert Kern
re also accepted for convenience and correspond to the C types that underlie the respective Python objects. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Release of NumPy 0.9.5

2006-02-17 Thread Robert Kern
rt(arr, mask, vals) Docstring: Similar to putmask arr[mask] = vals but the 1D array vals has the same number of elements as the non-zero values of mask. Inverse of extract. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the g

Re: Numpy for PythonCE

2006-02-18 Thread Robert Kern
"G���" wrote: > Hi, > is there a version of Numpy (or Numarray) available > that is compatible to PythonCE 2.3? I haven't heard of anyone trying. Perhaps you could try compiling the latest SVN of numpy and tell us how it goes on [EMAIL

Re: aborting without killing the python interpreter

2006-02-18 Thread Robert Kern
xceptions do *exactly* what you want in a very clean and simple way. They are a fundamental feature of Python. Do not fear them. They are your friends. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple assignment and the expression on the right side

2006-02-20 Thread Robert Kern
e wordings are mine. I am not sure if this is what he > intended]. No, it isn't. He says, "Each time the statement executes, the right-hand side expression is evaluated once." "[T]he statement" refers to the multiple assignment as a whole. -- Robert Kern [EMAIL PROTECTE

Re: Using CHACO and UNICODE

2006-02-21 Thread Robert Kern
help here. This is the appropriate list: https://mail.enthought.com/mailman/listinfo/enthought-dev -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: deriving from float or int

2006-02-21 Thread Robert Kern
is a reason. http://www.python.org/2.2.3/descrintro.html#__new__ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: deriving from float or int

2006-02-21 Thread Robert Kern
not subclass from floats since it tries to be agnostic about the kind of value you can assign a unit to. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: May i customize basic operator (such as 1==3)?

2006-02-21 Thread Robert Kern
Casey Hawthorne wrote: > I believe you are asking for a side effect from the "==" operator. > > Add print statements to the __eq__ method. The things is, he wants to make those modifications to builtin types, which he can't do. -- Robert Kern [EMAIL PROTECTED] "In

Re: May i customize basic operator (such as 1==3)?

2006-02-21 Thread Robert Kern
ver grow the ability to modify methods on the builtin types. We've discussed several times before, and you can search the archives of this list if you want more information why this is so. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the gra

Re: May i customize basic operator (such as 1==3)?

2006-02-22 Thread Robert Kern
rly good advice for Python. > Then one is prepared to change objects at will and not rely on any > special properties of the builtin types! If you really want to do that, go ahead. I won't stop you. I won't use your code, either. -- Robert Kern [EMAIL PROTECTED] "In the fields

Re: May i customize basic operator (such as 1==3)?

2006-02-22 Thread Robert Kern
kanchy kang wrote: > Is there any improvement version for standard unittest module? > for example, output log information as files. Several! Some build on the framework of unittest.py: nose, OOBTest, testosterone. Some don't: py.test, Sancho. -- Robert Kern [EMAIL PROTECTED] "

Re: why don't many test frameworks support file-output?

2006-02-22 Thread Robert Kern
n you can use pipes. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: computer algebra packages

2006-02-23 Thread Robert Kern
iggybacking.] http://sage.sourceforge.net/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Numerical solver

2006-02-28 Thread Robert Kern
) iprint -- controls the frequency of output: 0 (no output),1,2,3 maxfun -- maximum number of function evaluations. Returns: x -- the minimum -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die.&quo

Re: Numerical solver

2006-03-01 Thread Robert Kern
Laszlo Zsolt Nagy wrote: > Robert Kern wrote: > >>In [7]: scipy.optimize.fmin_cobyla? >> >>Type: function >>Base Class: >>String Form: >>Namespace: Interactive >>File: >>/Library/Frameworks/Python.framework/Versions/2.4

Re: how to overload sqrt in a module?

2006-03-02 Thread Robert Kern
ts the features you want. In [8]: class A(object): ...: def __init__(self, x): ...: self.x = x ...: def sqrt(self): ...: return 2*self.x ...: ...: In [9]: a = A(10) In [10]: import numpy In [11]: numpy.sqrt(a) Out[11]: 20 In [12]: numpy.sqrt(10) Out[12]:

Re: how to overload sqrt in a module?

2006-03-02 Thread Robert Kern
), that someone was Travis Oliphant. For anything else you want, that someone is probably you. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: scipy

2006-03-03 Thread Robert Kern
d will continue. I expect that we will be placing tarballs on PyPI soon. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: forcing exceptions

2006-03-03 Thread Robert Kern
ur code should be unicode strings, and you shouldn't try to pass around encoded regular strings if at all possible, although pure ASCII strings generally work because it is the default encoding. So double-check self.sect[1] and figure out why it isn't a unicode string. -- Robert Kern

Re: add an asynchronous exception class

2006-03-04 Thread Robert Kern
ected (it needed changing the semantics > of "except:"). Also, PEP 348 was rejected and is a huge, complex > reorganization of the whole exception system. The relevant part of PEP 348 survived as PEP 352. http://www.python.org/peps/pep-0352.html -- Robert Kern [EMAIL PROTECTED]

Re: Advice from distutils experts?

2006-03-04 Thread Robert Kern
27;) if newer(__file__, target): # ... parse Python headers contents = """ #include "Python.h" /* ... */ """ % (stuff, more_stuff) f = open(target, 'w') f.write(contents) f.close() return target ext = Exte

Re: Python advocacy in scientific computation

2006-03-04 Thread Robert Kern
Is or APIs > that look funny. We are used to seeing sin(x) in our calculus textbooks > and because of that we don't find Math.Sin(x) particularly elegant -- > even though Math.Sin(x) is more OOP and sin(x) clutters the global > namespace. > > Now please go ahead and tell me how Python can help me become a better > scientist. And try to steer clear of the computer science buzzwords > that don't mean anyting to me. 1. You will probably spend less time writing and running software. 2. If you play your cards right, more people will be able to use and improve your software. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python advocacy in scientific computation

2006-03-04 Thread Robert Kern
. Are you tried using ipython in pylab mode? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python advocacy in scientific computation

2006-03-05 Thread Robert Kern
Michael Tobis wrote: >> $ rm `find . -name "*.pyc"` > > Ouch. Is that a true story? Yup. Fortunately, it was a small, purely personal project, so it was no huge loss. It was enough for me to start using CVS on my small, purely personal projects, though! -- Robert Kern

<    8   9   10   11   12   13   14   15   16   17   >