Re: Learning more about "The Python Way"

2005-06-13 Thread Robert Kern
e, the book is still worth buying for the discussion about each recipe that will help the reader learn more deeply how the code fits into "The Python Way." -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowe

Re: Is Python Suitable for Large Find & Replace Operations?

2005-06-13 Thread Robert Kern
#x27;m just tossing this out. I don't really have much experience with the algorithm, but when searching for multiple targets, an Aho-Corasick automaton might be appropriate. http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/ Good luck! -- Robert Kern [EMAIL PROTECTED] "In the fiel

Re: Is Python Suitable for Large Find & Replace Operations?

2005-06-13 Thread Robert Kern
Robert Kern wrote: > I'm just tossing this out. I don't really have much experience with the > algorithm, but when searching for multiple targets, an Aho-Corasick > automaton might be appropriate. > > http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/ More

Re: Tiff Image Reader/writer

2005-06-13 Thread Robert Kern
capability? -- 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: Tiff Image Reader/writer

2005-06-13 Thread Robert Kern
mes: user 0.00 s, sys: 0.01 s, total: 0.01 s Wall time: 0.03 In [9]: img2.size Out[9]: (2400, 4800) -- 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: Tiff Image Reader/writer

2005-06-15 Thread Robert Kern
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Robert Kern > wrote: > >>PyPK wrote: >> >>>One reason why I don't want to use PIL is it seems very slow for tiff >>>images of very large sizes(2400x4800). So I am looking for a be

Re: Tiff Image Reader/writer

2005-06-15 Thread Robert Kern
Robert Kern wrote: > Marc 'BlackJack' Rintsch wrote: >>It's fast enough to open the file and read the meta-data. The OP wants to >>decode the actual pixels. > > Okay. > > In [12]: %time d = img.getdata() > CPU times: user 0.31 s, sys: 1.43 s, total:

Re: add new modules?

2005-06-17 Thread Robert Kern
Macintosh obviously) on basically > freeBSD, os I'm doing UNIX type stuff at the console. If you are using the Apple-supplied Python 2.3.5, put the modules in /Library/Python/2.3/site-packages/ . If you are using Bob Ippolito's Python 2.4.1, then it's /Library/Frameworks/Python.

Re: call function in console without paranthesis

2007-05-31 Thread Robert Kern
27;, 'bar' --> f('Foo', 'bar') ('Foo', 'bar') In [9]: f 1, 2, 3 --> f(1, 2, 3) (1, 2, 3) In [13]: x = 1 In [14]: f x ---> f(x) (1,) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless e

Re: Determinant of Large Matrix

2007-06-06 Thread Robert Kern
rix? Is there a python package that could > help me? If all of your matrices are going to be integers, doing the determinant-by-minors calculations yourself is probably easy enough to code and will retain complete precision. http://mathworld.wolfram.com/DeterminantExpansionbyMinors.html -- Ro

Re: questions about solving equations in scipy

2007-06-12 Thread Robert Kern
(unique) solution is within the constraint or it's not. Are you sure you don't want to find the minimum-error solution that obeys the constrain, 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

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-20 Thread Robert Kern
y and parts of the rest of the standard library may use them to implement their features. Implementing generic functions themselves don't require anyone to convince python-dev of anything. http://python.org/pypi/simplegeneric/0.6 http://peak.telecommunity.com/DevCenter/RulesReadme -- Robert Ker

Re: eggs considered harmful

2007-06-21 Thread Robert Kern
kages that are out there. There are a handful of packages that only distribute the eggs and not the source tarballs, but those are rare. -- 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: Issues with nonfunctioning VTK under python 2.5

2007-06-21 Thread Robert Kern
Eric Carlson wrote: > Any suggestions would be greatly appreciated. Please bring these bug reports to [EMAIL PROTECTED] and possibly make a ticket on our Trac. https://mail.enthought.com/mailman/listinfo/enthought-dev https://svn.enthought.com/enthought Thanks. -- Robert Kern &quo

Re: Setuptools, build and install dependencies

2007-06-22 Thread Robert Kern
to be able to do it. No, generic setup.py scripts don't do anything of that kind. -- 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: trouble installing numpy 1.0.2 and scipy.0.5.2

2007-06-23 Thread Robert Kern
e the exact error output. Similarly, for the scipy installation, please tell us exactly what steps you took and copy and paste the output. Thanks. -- 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 inte

Re: distutils/setuptools de-installation?

2007-06-25 Thread Robert Kern
, PyPgSQL among them, the above command isn't even > recognized. This _has_ to be a FAQ, doesn't it? Please help! distutils itself has no notion of uninstallation. You need to figure out what files the package installed and delete them yourself. -- Robert Kern "I have come to

Re: Looking for an interpreter that does not request internet access

2007-06-25 Thread Robert Kern
ter that does not access the internet > when it starts (or when it is running, unless I specifically write a > program that causes it to do so, so as a browser)? The regular interpreter works fine. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless e

Re: eggs considered harmful

2007-06-26 Thread Robert Kern
mation systems vs numerical analysis systems vs web server systems. > > 6. Refresh process which does not need to fiddle with egg-ness, or > even know about Python. Everything is a tarball. And all of these are obviated by the fact that easy_install can find and build source tarballs, too.

Re: _hashlib portability issue

2007-06-26 Thread Robert Kern
fo ld` has not enlightened me, either. -- 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: p & br using ElementTree?

2007-06-26 Thread Robert Kern
e .tail attribute on the br element: In [1]: from xml.etree import ElementTree as ET In [4]: p = ET.Element('p') In [5]: p.text = 'Current date:' In [6]: br = ET.SubElement(p, 'br') In [7]: br.tail = '2000-01-01' In [8]: ET.dump(p) Current date:2000-01-0

Re: Rappresenting infinite

2007-06-28 Thread Robert Kern
is a generic inf and > add the wish that that is not equal to itself (inf == inf would yield > nan). No. You can make one that fits your requirements, though. > Ideally, it would not be of type float and work with gmpy mpq. > But I might have rare requirements... Possibly. -- Robert

Re: Rappresenting infinite

2007-06-29 Thread Robert Kern
[EMAIL PROTECTED] wrote: > On Thu, 28 Jun 2007 23:20:30 -0500 > Robert Kern <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: >>> Does it differ from the >>> built-in inf? >> What built-in inf? > > $ python > Python 2.4.4 (#2, Ap

Re: Rappresenting infinite

2007-07-02 Thread Robert Kern
on't work on Windows, for example. Fortunately, it doesn't matter all that much (at least for those who just need to create such values; parsing them from files is another matter) since infs and nans can be constructed in a cross-platform way (at least for IEEE-754 platforms where these v

Re: Ask for a password with OptParse

2007-07-03 Thread Robert Kern
ot print the user's input to the screen. -- 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: Numpy array index handling

2007-07-13 Thread Robert Kern
ut < 0] = 10 * a[input < 0] In [7]: output[input > 0] = 20 * a[input > 0] If you are still having problems, please join us on numpy-discussion with the full traceback. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrib

Re: Numpy array index handling

2007-07-13 Thread Robert Kern
n reduce the typing burden somewhat like so: import numpy as N a = N.arange(10) That's a fairly common idiom in the numpy community. You can also import specific symbols if you know what you are going to use. If you're doing a lot of trig, for example: from numpy import sin, co

Re: Numpy array index handling

2007-07-13 Thread Robert Kern
n Enthought employee) haven't been updating the Enthought Edition. We are moving to a less monolithic approach with Python eggs. -- 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 thoug

Re: interactive graphical script builder

2007-07-13 Thread Robert Kern
per at Scripps (Sanner, lab). He has a prototype of this > type of thing for working with molecular models. I'm not sure how the > code is liscensed. It's called Vision, now, and it's only available for noncommercial, scientific research use. http://www.scripps.edu/%7Esann

Re: comparison with None

2007-04-18 Thread Robert Kern
comparisons is not always a good idea. > Better to: > from types import NoneType > > x = None > if type( x ) == NoneType: > # true > < code > > else: > # false; do something else. > < more code > The recommended idiom is to test for "

Re: matplotlib basic question

2007-04-20 Thread Robert Kern
Colin J. Williams wrote: > I'm not sure that scipy has been updated to Python 2.5 ? scipy certainly works with 2.5. Are you referring to something else perhaps? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible b

Re: matplotlib basic question

2007-04-20 Thread Robert Kern
Tommy Grav wrote: > On Apr 20, 2007, at 2:44 PM, Robert Kern wrote: >> Colin J. Williams wrote: >> >>> I'm not sure that scipy has been updated to Python 2.5 >> ? scipy certainly works with 2.5. Are you referring to something >> else perhaps? > >

Re: how to get a wrap aound slice of numpy array

2007-04-20 Thread Robert Kern
I know that x[0:2] would give [0,1], and > x[-1] give [4], is there a way that I can get [4,0,1]. I try x[-1:2], > but it returns an empty array. x[[-1, 0, 1]] -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our o

Re: No speedup on multi-processor machine?

2007-04-21 Thread Robert Kern
can be 'valid', 'same', or 'full' to specify size of the resulting sequence. -- 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 underly

Re: matplotlib basic question

2007-04-23 Thread Robert Kern
Pete Forman wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > > > Colin J. Williams wrote: >>> I'm not sure that scipy has been updated to Python 2.5 > > ? scipy certainly works with 2.5. Are you referring to something > > else perhaps? >

Re: Numpy problem: Arrays in a list of dictionaries

2007-04-23 Thread Robert Kern
I think my problem is: how to create a new array every time I append > it to the list... import copy d1 = {1: array([2, 3, 4]), 2: ''} l1 = [] for i in range(3): l1.append(copy.deepcopy(d1)) -- Robert Kern "I have come to believe that the whole world is an enigma

Re: noob questions

2007-04-24 Thread Robert Kern
ading all of them all of the time takes substantial amounts of time. Also, I don't recommend using either pkgload or "from scipy import *" in code. However, from the interactive prompt, feel free. That is precisely what these features were designed for. -- Robert Kern "I hav

Re: need help with ODE solver from scipy

2007-04-24 Thread Robert Kern
> Although, to be fair this is after the output from one iteration: > > array([0.01, 1. , 1. ]) > > So, clearly this isn't working right. Does anyone have any experience > using this function or anything they can contribute? I tried your example and it worked for me (af

Re: Preferred Random Library

2007-04-25 Thread Robert Kern
ributions implemented. numpy.random does not implement jumpahead(). random, naturally, does not require a third-party package. By and large, I'd say the distinguishing factor is whether or not you want to use numpy in your program. If so, then use numpy.random. If not, then use random. -- Robe

Re: Import Problems

2007-04-27 Thread Robert Kern
at a higher level for external callers. If you have a module whose contents are being exposed in your __init__.py, never rely on the contents of that __init__.py in that code. Instead, go straight to the real modules that implement the symbols that you need. So mytest.py should read: from importtest.tes

Re: Numeric + wxPython, can't understand a bug...

2007-04-27 Thread Robert Kern
essage... wx.Point objects are being recognized as sequences by array(). Consequently, reshape() thinks you are trying to reshape a (height*width, 2) array into a (height, width) array. You might want to create an empty (height, width) PyObject array first, and simply assign wx.Point values into i

Re: howto make Python list from numpy.array?

2007-05-06 Thread Robert Kern
lst = list(arr) For N-D arrays, that will give you a list of arrays. If you want a list of lists (of lists of lists ... etc N times), use the .tolist() method of arrays. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made t

Re: howto make Python list from numpy.array?

2007-05-06 Thread Robert Kern
ist() > Traceback (most recent call last): > File "", line 1, in > ValueError: rank-0 arrays don't convert to lists. > > Here I used Python 2.4.3, numpy 1.02 All of these results are entirely correct. A scalar (or rank-0 array) is not a sequence. If you have a need to

Re: change of random state when pyc created??

2007-05-09 Thread Robert Kern
hich is non-random, varies across Python implementations, and depends on the dictionary's history of insertions and deletions. """ The sets documentation is a bit less explicit, though. http://docs.python.org/lib/types-set.html """ Like other collections, sets

Re: Single precision floating point calcs?

2007-05-09 Thread Robert Kern
) Out[10]: True In [11]: 1.0 + 1e-8 == 1.0 Out[11]: False If you can afford to be slow, I believe there is an ASPN Python Cookbook recipe for simulating floating point arithmetic of any precision. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma th

Re: change of random state when pyc created??

2007-05-09 Thread Robert Kern
Alan G Isaac wrote: > Robert Kern wrote: >> http://docs.python.org/lib/typesmapping.html >> """ >> Keys and values are listed in an arbitrary order which is non-random, varies >> across Python implementations, and depends on the dictionary's history o

Re: change of random state when pyc created??

2007-05-09 Thread Robert Kern
Alan Isaac wrote: >>> Robert Kern wrote: >>>> http://docs.python.org/lib/typesmapping.html >>>> """ >>>> Keys and values are listed in an arbitrary order which is non-random, > varies >>>> across Python implementations,

Re: change of random state when pyc created??

2007-05-09 Thread Robert Kern
Steven D'Aprano wrote: > On Wed, 09 May 2007 21:18:25 -0500, Robert Kern wrote: > >> Actually, the root cause of Peter's specific example is the fact that the >> default implementation of __hash__() and __eq__() rely on identity >> comparisons. >> Two sepa

Re: change of random state when pyc created??

2007-05-10 Thread Robert Kern
mory location of the elements. It's misleading. It only depends on the memory location of the elements if __hash__() is implemented as id() (the default). How about this? """Never rely on the order of dictionaries and sets.""" -- Robert Kern "

Re: Trying to choose between python and java

2007-05-15 Thread Robert Kern
3.0 team. They've already implemented the translation for print statements, too: http://svn.python.org/view/sandbox/trunk/2to3/ http://svn.python.org/view/sandbox/trunk/2to3/fixes/fix_print.py?rev=54501&view=auto -- Robert Kern "I have come to believe that the whole world is

Re: try

2007-05-16 Thread Robert Kern
ept: > else: > print "couldn't find incident" The except: block still needs something in it, even if it is just "pass". -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our ow

Re: FreeType

2007-05-17 Thread Robert Kern
ill need to install libfreetype, then build matplotlib. -- 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.pytho

Re: FreeType

2007-05-17 Thread Robert Kern
Steve Holden wrote: > Alternatively use the Python Imaging Library (PIL), which I believe > includes freetype support. The OP seems to be trying to build matplotlib, which actually does require the FreeType library. The PIL, lovely though it is, is not a substitute. -- Robert Kern &

Re: namespace question

2007-05-18 Thread Robert Kern
= 2 c = 4 def myFun(self): print self.a, self.b, myClass.c return numpy.sin(self.a) -- 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: docs patch: dicts and sets

2007-05-19 Thread Robert Kern
t to the bottom of an issue they > are having by reading those comments. And most will simply be confused. -- 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 under

Re: 0 == False but [] != False?

2007-05-23 Thread Robert Kern
uot;. For empty lists, strings, tuples, dicts and some other things, "bool(foo) == False", while for lists, etc., with at least one element, "bool(foo) == True". -- 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: Different methods with same name but different signature?

2007-05-24 Thread Robert Kern
No. -- 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: Newsgroups and mailing lists (was Re: Slightly OT: Why all the spam?)

2007-05-24 Thread Robert Kern
Aahz wrote: > These days, because of the cancelbot wars, ... Heh. Sounds like a particularly dire episode of Doctor Who. -- 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 thoug

Re: Long double in Python

2007-05-25 Thread Robert Kern
99969733e+199 In [58]: x * x Out[58]: 9.99939489e+399 In [59]: x * x * x Out[59]: 9.99909194e+599 In [60]: 1e200 * 1e200 * 1e200 Out[60]: inf -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by

Re: printing list, is this a bug?

2007-05-25 Thread Robert Kern
__, __repr__ will get > called. Is this a bug? No, it's deliberate design. The string representation of a list object, either list.__str__() or list.__repr__(), uses the __repr__() of its contained objects. -- Robert Kern "I have come to believe that the whole world is an enigma, a

Re: Another C API Question

2007-07-26 Thread Robert Kern
to double without writing a giant switch() that exhausts > every single type of number? Convert it to a Python float using PyNumber_Float(), then use PyFloat_AsDouble() to get the C double value from it. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless eni

Re: bias in random.normalvariate??

2007-08-03 Thread Robert Kern
; hi=mean > sd=10 > sum=0 > while(i<=samplen): > x=random.normalvariate(mean,sd) > #print x > if x if x>hi: high=x > sum+=x > i+=1 > print 'sample mean=', sum/samplen, '\n' > print 'low value =', l

Re: SciPy's site is down

2007-08-08 Thread Robert Kern
orrectly on Python 2.5 on WinVista? If you can connect again to scipy.org, please tell us the problems you've had installing numpy on Vista at [EMAIL PROTECTED] I believe that someone has mentioned that the binary installer worked fine for them. http://scipy.org/Mailing_Lists -- Robert Ke

Re: Python not freeing memory (?)

2007-08-12 Thread Robert Kern
s unlikely that the bug is in Python. Let's bring it over to numpy-discussion. What version of numpy are you using? Can you give us a complete example that demonstrates the leak? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terri

Re: Array and floating point

2007-08-17 Thread Robert Kern
pend(float("0.1")) >>>> x[0] > 0.1000149011612 >>>> float("0.1") > 0.10001 > > I'm expecting x[0] = 0.10001 'f' denotes a single-precision floating point number. Python's float objects are double-precision fl

Re: Mouse control with ctypes in OS X

2007-08-20 Thread Robert Kern
uses this API. It's only available in OSX 10.4, however. http://developer.apple.com/documentation/Carbon/Reference/QuartzEventServicesRef/index.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

Re: CIE Colorspace Conversions

2007-08-20 Thread Robert Kern
kern/cgi-bin/hgwebdir.cgi/lcms Let me know if there is anything I can do to make this code more useful 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: Mouse control with ctypes in OS X

2007-08-20 Thread Robert Kern
Robert Kern wrote: > Googling around a bit more, however, I see that the Quartz Event Services is > documented and provides similar functionality. The DarwiinRemote project has a > mouse emulation mode for the Nintendo Wii controller that uses this API. It's > only available in

Re: datetime in microseconds

2007-08-20 Thread Robert Kern
Robert Dailey wrote: > A small off topic question. Why use divmod() instead of the modulus > operator? Because he needed both the quotient and the remainder. % only gives you the remainder. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enig

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
W. Watson wrote: > Is there a single source that explains these statements? http://docs.python.org/tut/node8.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

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
lob, bisect, and datetime are standard library modules. http://docs.python.org/modindex.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." --

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
W. Watson wrote: > Thanks very much. Where's the global index? http://docs.python.org/modindex.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 und

Re: Co-developers wanted: document markup language

2007-08-24 Thread Robert Kern
Wildemar Wildenburger wrote: > Torsten Bronger wrote: >> Hallöchen! >> > Yes, you're German. Have you ever noticed that (we) Germans are > virtually the only ones that feel the need to rub our nationality into > everyones faces? ;) Howdy! We Americans do the sa

Re: Biased random?

2007-08-27 Thread Robert Kern
hem do what I need? > > That's weird. random.randint(a,b) will be enough for most cases. Test > your system to see the distribution is uniform with something like: The distribution is uniform. However, he wants a way to get non-uniform sampling of that list. -- Robert Kern "

Re: list index()

2007-08-30 Thread Robert Kern
A that are not in directory B. > I have used exceptions in other languages and only do so on logic that > should never happen. Python is different than those languages. Exceptions are used much more frequently in Python and often for things that will *definitely* happen not just those things t

Re: subclassing Python types

2007-08-30 Thread Robert Kern
__init__() method on str. class MyString(str): def __init__(self, strInput): str.__init__(self, strInput) # ... other stuff -- 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 interpr

Re: Biased random?

2007-08-30 Thread Robert Kern
o the 0s stack. # # ### ### 0123 The method does not work because of that. -- 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: strings (dollar.cents) into floats

2007-08-30 Thread Robert Kern
I won't have problems. Binary floating point has the advantage of being widely implemented and quite fast compared to decimal floating point. -- 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 inter

Re: Biased random?

2007-08-31 Thread Robert Kern
Jeffrey Barish wrote: > Robert Kern wrote: > >> Ivan Voras wrote: >>> Jeffrey Barish wrote: >>> >>>> If you take the difference between two uniformly distributed random >>>> variables, the probability density function forms an isosceles tr

Re: Biased random?

2007-08-31 Thread Robert Kern
Jeffrey Barish wrote: > I'm sorry that I took the time to respond. I'm sorry. I didn't intend my post to be as harsh as it was. -- 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: Looking for Delaunay triangulation module...

2007-09-02 Thread Robert Kern
into a separate package. If you can remember what problems you had, I'd like to fix them. I'm clearing up a number of (really dumb) memory leaks. -- 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: Applying transformation matrix to 3D vertex coordinates

2007-09-03 Thread Robert Kern
t; 0.4294860.1897141.]] > > Am I going in the right direction? No. The reshape didn't do what you want it to. The elements will have the same order; it won't transpose the array. To do that, use the transpose() function. > What do I do with the result? :) When

Re: scipy.org website

2007-09-04 Thread Robert Kern
py-user/2007-September/013573.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: Python and CUDO

2007-09-06 Thread Robert Kern
DA" rather than "NIVIDAS CUDO"). http://code.google.com/p/pystream/ -- 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: Python and CUDO

2007-09-07 Thread Robert Kern
Paddy wrote: > On Sep 6, 10:12 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Veronika Lindstrand Kant wrote: >>> Hi! >>> I just wonder if there are any plans for building any support using >>> NIVIDAS CUDO plattform into python? >> Not into Pytho

Re: noob: reloading modified python file within Python Shell

2007-09-10 Thread Robert Kern
johnny wrote: > from people.models import * > > Now I make changes to the models.py. How do I reload this module in > Python Shell? import people.models reload(people.models) from people.models import * -- Robert Kern "I have come to believe that the whole world is an e

Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Robert Kern
"", line 1, in > TypeError: list indices must be integers >>>> l[...] > Traceback (most recent call last): > File "", line 1, in > TypeError: list indices must be integers > > So where is this extended slicing used? numpy for multidimensional a

Re: Is numeric keys of Python's dictionary automatically sorted?

2007-03-07 Thread Robert Kern
John wrote: > Then is there anyway to sort the numeric keys and avoid future implemetation > confusion? sorted(mydict.keys()) -- 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: pylint: don't warn about tabs

2007-03-08 Thread Robert Kern
Alan Isaac wrote: > I am brand new to pylint. > As a tab user, I want the tabs warning turned off. > How? > > Larger question: > where is the config file format documented? doc/features.txt examples/pylintrc -- Robert Kern "I have come to believe that the whole world i

Re: distributed queue?

2007-03-10 Thread Robert Kern
t > already exists. I see a little bit of discussion in the newsgroup > archive but no obvious pointers to code. Take a look at the work being done on IPython: http://ipython.scipy.org/moin/Parallel_Computing -- Robert Kern "I have come to believe that the whole world is an enigm

Re: nonlinear interpolation

2007-03-12 Thread Robert Kern
up.cru.fr/projects/scientific-py/ scipy also has a variety of curve fitting routines at the expense of a more involved install. scipy.optimize.leastsq() might be sufficient for you, but the scipy.odr package is much more flexible (but get scipy from SVN for that; the latest release has some unfortun

Re: Questions on migrating from Numeric/Scipy to Numpy

2007-03-13 Thread Robert Kern
ray([[1, 2, 3], [4, 4, 4], [4, 5, 6], [5, 5, 5], [7, 8, 9]]) The behaviour that you seem to want would be accomplished with the following: In [3]: a = zeros(5) In [4]: mask = zeros(5, dtype=bool) In [5]: mask[1] = True In [6]: mask Out[6]: array([False

Re: Questions on migrating from Numeric/Scipy to Numpy

2007-03-13 Thread Robert Kern
back. Hmm. Odd. I just tried to register and haven't gotten a confirmation email, yet, either. I'll get our sysadmin on 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 as though

Re: Questions on migrating from Numeric/Scipy to Numpy

2007-03-13 Thread Robert Kern
a > array([ 100., 100.,0.,0.,0.]) > > I found this strange. It should just give an error if you try to use a > mask array of non booleans. No, it simply does something different. Boolean arrays apply as a mask. Integer arrays apply as indices into the array. -- Robert Ker

Re: Questions on migrating from Numeric/Scipy to Numpy

2007-03-14 Thread Robert Kern
ght; it is much improved), then that should be all that you need to do to get your old extension modules running with numpy. -- 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 ha

Re: Python eggs and openSuse 10.2 errors

2007-03-14 Thread Robert Kern
/usr/lib/ > python2.5/config/Makefile (No such file or directory) > > The /usr/lib/python2.5/config directory didnt exist, so I tried > creating it but with no change in results. You need to install the development package for python. It should be called python2.5-devel or something

Re: newb: Python Floating Point

2007-03-15 Thread Robert Kern
johnny wrote: > When I do the following, rounding to 2 decimal places doesn't seem to > work. I should get 0.99 : > >>>> a =0.99 >>>> a > 0.98999 >>>> round(a,2) > 0.989999999 http://docs.python.org/tut/node16.html

Re: distributing python software in jar like fashion

2007-03-16 Thread Robert Kern
ools. Squisher is good for distributing an application with all of its dependencies in a single file; it is not a packager or installer for libraries. Eggs are good for distributing libraries and plugins and their dependencies. -- Robert Kern "I have come to believe that the whole world is a

Re: Weekly Python Patch/Bug Summary

2007-03-17 Thread Robert Kern
e code that you will > have to compile. If TortoiseSVN only copies repositories and reads and > does not update, then you need svn itself. But I know almost nothing about > it except the name. It's a fully-functional SVN client. It can update. -- Robert Kern "I have com

Re: design question: generator object with other attributes

2007-03-22 Thread Robert Kern
his class will have a ``next`` method that simply > returns the value the object get by calling the wrapped > generator. You will probably also need to define def __iter__(self): return self if I remember correctly. -- Robert Kern "I have come to believe that the whole world is an

<    10   11   12   13   14   15   16   17   18   19   >