From genietdev0 at iol.ie Mon Aug 1 05:26:32 2005 From: genietdev0 at iol.ie (Victor Reijs) Date: Mon, 01 Aug 2005 10:26:32 +0100 Subject: [SciPy-user] PSP python (was crashing python) In-Reply-To: <42ED56B3.4040308@iol.ie> References: <1122843846.7527@mail.enthought.com> <42ED417A.2010807@iol.ie> <42ED435B.7060105@ucsd.edu> <42ED469B.1090304@iol.ie> <42ED4795.8070907@iol.ie> <42ED490D.1000903@iol.ie> <42ED4DEB.9050602@iol.ie> <42ED4F7C.3010403@ucsd.edu> <42ED56B3.4040308@iol.ie> Message-ID: <42EDEAC8.5090601@iol.ie> Hello Robert, The below with 'False' also happened in the tnc.py file (perhaps in more files in the scipy directories, but I did not check). All the best, Victor Victor Reijs wrote: > Hello Robert, > > That helped! Thanks. It now looks to work. I will do some more testing. > > All the best, > > > Victor > > Robert Kern wrote: > >> Victor Reijs wrote: >> >>> File "C:\Python22\Lib\site-packages\scipy\optimize\lbfgsb.py", line >>> 33, in ? >>> def fmin_l_bfgs_b(func, x0, fprime=None, args=(), >>> NameError: name 'False' is not defined" >> >> >> >> Oops. Looks like we introduced a Python 2.3 dependency. You can just >> change False to 0. >> > From genietdev0 at iol.ie Mon Aug 1 06:41:05 2005 From: genietdev0 at iol.ie (Victor Reijs) Date: Mon, 01 Aug 2005 11:41:05 +0100 Subject: [SciPy-user] in search of a different fmin method Message-ID: <42EDFC41.2070101@iol.ie> Hello all of you, I now have scipy working for PSP8 (based on python 2.2) and I use fmin (or fmin_Powell); the results are as if these method only find a local minimum and not the global minimum. I have the same problem programmed in MS Excel 2000 and using Excel Solver it looks from the result that the global minimum is found (MS Excel 2000 uses Generalized Reduced Gradient Algorithm: http://support.microsoft.com/kb/q214115/ ). Do people know if such a fmin is also available in Python? Thanks for you feedback. All the best, Victor From rkern at ucsd.edu Mon Aug 1 06:50:24 2005 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 01 Aug 2005 03:50:24 -0700 Subject: [SciPy-user] in search of a different fmin method In-Reply-To: <42EDFC41.2070101@iol.ie> References: <42EDFC41.2070101@iol.ie> Message-ID: <42EDFE70.5090503@ucsd.edu> Victor Reijs wrote: > Hello all of you, > > I now have scipy working for PSP8 (based on python 2.2) and I use fmin > (or fmin_Powell); the results are as if these method only find a local > minimum and not the global minimum. > > I have the same problem programmed in MS Excel 2000 and using Excel > Solver it looks from the result that the global minimum is found (MS > Excel 2000 uses Generalized Reduced Gradient Algorithm: > http://support.microsoft.com/kb/q214115/ ). This algorithm is not a global optimizer. See the section "Multiple Locally Optimum Points" on that page. > Do people know if such a fmin is also available in Python? We don't have many global optimizers. There's a simulated annealing implementation in scipy.optimize.anneal(). There's also a genetic algorithm implementation in scipy.ga, but I think it may have succumbed to bit-rot by now. Global optimization is hard in general, though, and it takes significant experience with the algorithm to tune it for your problem. Good luck! -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From genietdev0 at iol.ie Mon Aug 1 07:03:43 2005 From: genietdev0 at iol.ie (Victor Reijs) Date: Mon, 01 Aug 2005 12:03:43 +0100 Subject: [SciPy-user] in search of a different fmin method In-Reply-To: <42EDFE70.5090503@ucsd.edu> References: <42EDFC41.2070101@iol.ie> <42EDFE70.5090503@ucsd.edu> Message-ID: <42EE018F.2080506@iol.ie> Hello Robert, Robert Kern wrote: > This algorithm is not a global optimizer. See the section "Multiple > Locally Optimum Points" on that page. Understood, but at least with my problem it looks that the Excel method reaches easier the global minimum then Nelder-Mead and Powell (both stay in the many local minima I seem to have in my problem;-). I did not expect that my problem had so many minima;-): http://www.iol.ie/~geniet/eng/eng/IFRAOcoloropt.htm#Method It looks Broyden-Flechter-Golfarb-Shanno is doing a better job (also does not need a fprime, which I don't have). > We don't have many global optimizers. There's a simulated annealing > implementation in scipy.optimize.anneal(). There's also a genetic > algorithm implementation in scipy.ga, but I think it may have succumbed > to bit-rot by now. > > Global optimization is hard in general, though, and it takes significant > experience with the algorithm to tune it for your problem. Good luck! Oke I will browse around and do some more testing. Thanks for the links. All the best, Victor From dimitri.dor at fssintl.com Mon Aug 1 10:18:08 2005 From: dimitri.dor at fssintl.com (Dimitri D'Or) Date: Mon, 1 Aug 2005 16:18:08 +0200 Subject: [SciPy-user] Numerical gradient approximation on matrix In-Reply-To: <20050730112604.2D9B33EB97@www.scipy.com> Message-ID: <200508011418.j71EI81M017001@outmx005.isp.belgacom.be> > Message: 7 > Date: Fri, 29 Jul 2005 14:42:12 -0400 > From: Alan G Isaac > Subject: Re[2]: [SciPy-user] Numerical gradient approximation on > matrix > To: SciPy Users List > Message-ID: > Content-Type: TEXT/PLAIN; CHARSET=UTF-8 > > On Fri, 29 Jul 2005, T) guillem at torroja.dmt.upm.es apparently wrote: > > The difference is that gradient.m computes the gradient > > and keeps the array's shape: > > How's that supposed to work. > I'm not a Matlab user, > but the docs say it uses diff. > > Cheers, > Alan Isaac The Matlab gradient function doesn't use diff. It raises similar but not identical results to diff. A short example to illustrate this: Take a matrix A: A = 9 1 1 3 9 4 2 2 4 8 2 0 9 0 6 7 >> [Fx,Fy]=gradient(A) Fx = -8.0000 -4.0000 1.0000 2.0000 -5.0000 -3.5000 -1.0000 0 4.0000 -1.0000 -4.0000 -2.0000 -9.0000 -1.5000 3.5000 1.0000 Fy = 0 3.0000 1.0000 -1.0000 -2.5000 3.5000 0.5000 -1.5000 0 -2.0000 2.0000 2.5000 5.0000 -8.0000 4.0000 7.0000 >> diff(A) ans = 0 3 1 -1 -5 4 0 -2 5 -8 4 7 >> diff(A,1,2) ans = -8 0 2 -5 -2 0 4 -6 -2 -9 6 1 The values for the intermediary cells of dx are computed as A[i,j]=(A[i+1,j]-A[i-1,j])/(2*H[0]), where H[0] is the spacing between the columns (equal to 14 by default). Working along the same lines with j as varying index yields dy. I've written my own gradient function (see joined file) that works with matrix of dimensions 1, 2 or 3, but I have difficulties for a generalization to N dimensions. Does someone have an idea? Thanks, Dimitri -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gradient.py Type: application/octet-stream Size: 4343 bytes Desc: not available URL: From dimitri.dor at fssintl.com Mon Aug 1 10:22:55 2005 From: dimitri.dor at fssintl.com (Dimitri D'Or) Date: Mon, 1 Aug 2005 16:22:55 +0200 Subject: [SciPy-user] Numerical gradient approximation on matrix Message-ID: <200508011423.j71EMsnU021703@outmx017.isp.belgacom.be> > Message: 7 > Date: Fri, 29 Jul 2005 14:42:12 -0400 > From: Alan G Isaac > Subject: Re[2]: [SciPy-user] Numerical gradient approximation on > matrix > To: SciPy Users List > Message-ID: > Content-Type: TEXT/PLAIN; CHARSET=UTF-8 > > On Fri, 29 Jul 2005, T) guillem at torroja.dmt.upm.es apparently wrote: > > The difference is that gradient.m computes the gradient > > and keeps the array's shape: > > How's that supposed to work. > I'm not a Matlab user, > but the docs say it uses diff. > > Cheers, > Alan Isaac The Matlab gradient function doesn't use diff. It raises similar but not identical results to diff. A short example to illustrate this: Take a matrix A: A = 9 1 1 3 9 4 2 2 4 8 2 0 9 0 6 7 >> [Fx,Fy]=gradient(A) Fx = -8.0000 -4.0000 1.0000 2.0000 -5.0000 -3.5000 -1.0000 0 4.0000 -1.0000 -4.0000 -2.0000 -9.0000 -1.5000 3.5000 1.0000 Fy = 0 3.0000 1.0000 -1.0000 -2.5000 3.5000 0.5000 -1.5000 0 -2.0000 2.0000 2.5000 5.0000 -8.0000 4.0000 7.0000 >> diff(A) ans = 0 3 1 -1 -5 4 0 -2 5 -8 4 7 >> diff(A,1,2) ans = -8 0 2 -5 -2 0 4 -6 -2 -9 6 1 The values for the intermediary cells of dx are computed as A[i,j]=(A[i+1,j]-A[i-1,j])/(2*H[0]), where H[0] is the spacing between the columns (equal to 14 by default). Working along the same lines with j as varying index yields dy. I've written my own gradient function (see http://www.scipy.net/pipermail/scipy-user/attachments/20050801/8000d103/grad ient.obj) that works with matrix of dimensions 1, 2 or 3, but I have difficulties for a generalization to N dimensions. Does someone have an idea? Thanks, Dimitri -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliphant at ee.byu.edu Mon Aug 1 16:02:59 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Mon, 01 Aug 2005 14:02:59 -0600 Subject: [SciPy-user] Numerical gradient approximation on matrix In-Reply-To: <200508011423.j71EMsnU021703@outmx017.isp.belgacom.be> References: <200508011423.j71EMsnU021703@outmx017.isp.belgacom.be> Message-ID: <42EE7FF3.90300@ee.byu.edu> Dimitri D'Or wrote: >> Message: 7 > >> Date: Fri, 29 Jul 2005 14:42:12 -0400 > >> From: Alan G Isaac > >> Subject: Re[2]: [SciPy-user] Numerical gradient approximation on > >> matrix > >> To: SciPy Users List > >> Message-ID: > >> Content-Type: TEXT/PLAIN; CHARSET=UTF-8 > >> > >> On Fri, 29 Jul 2005, T) guillem at torroja.dmt.upm.es apparently wrote: > >> > The difference is that gradient.m computes the gradient > >> > and keeps the array's shape: > >> > >> How's that supposed to work. > >> I'm not a Matlab user, > >> but the docs say it uses diff. > >> > >> Cheers, > >> Alan Isaac > > > > The Matlab gradient function doesn't use diff. It raises similar but > not identical results to diff. A short example to illustrate this: > > > Attached is a MATLAB-compatible N-dimensional gradient function using central differences on the interior and forward/backward differences on the edges. Notice the use of slice objects to generalize to N-dimensions. This technique can be used in many situations and is quite handy. It can make the code a little harder to read. -Travis -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: gradient.py URL: From brendansimons at yahoo.ca Mon Aug 1 17:49:07 2005 From: brendansimons at yahoo.ca (Brendan Simons) Date: Mon, 1 Aug 2005 17:49:07 -0400 Subject: [SciPy-user] Numerical gradient approximation on matrix In-Reply-To: <20050801190322.582203EB38@www.scipy.com> References: <20050801190322.582203EB38@www.scipy.com> Message-ID: <14ef856382425acd9953220cf453e802@yahoo.ca> Just in case it wasn't clear: Travis rocks. Should this func be added to scipy? -Brendan -- Brendan Simons On 1-Aug-05, at 3:03 PM, Travis Oliphant wrote: > Attached is a MATLAB-compatible N-dimensional gradient function using > central differences on the interior and forward/backward differences on > the edges. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From oliphant at ee.byu.edu Mon Aug 1 18:22:42 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Mon, 01 Aug 2005 16:22:42 -0600 Subject: [SciPy-user] Numerical gradient approximation on matrix In-Reply-To: <14ef856382425acd9953220cf453e802@yahoo.ca> References: <20050801190322.582203EB38@www.scipy.com> <14ef856382425acd9953220cf453e802@yahoo.ca> Message-ID: <42EEA0B2.2060909@ee.byu.edu> Brendan Simons wrote: > Just in case it wasn't clear: Travis rocks. > Should this func be added to scipy? I just added it. I'm very interested in adding more functions like this. Thanks for the impetus. -Travis From jdhunter at ace.bsd.uchicago.edu Tue Aug 2 09:30:20 2005 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue, 02 Aug 2005 08:30:20 -0500 Subject: [SciPy-user] ANN: matplotlib 0.83.2 Message-ID: <87slxszcsz.fsf@peds-pc311.bsd.uchicago.edu> This is a summary of recent developments in matplotlib since 0.80. For detailed notes, see http://matplotlib.sf.net/whats_new.html, http://matplotlib.sf.net/CHANGELOG and http://matplotlib.sf.net/API_CHANGES == Whats New == matplotlib wiki: this was just launched a few days ago and only has two entries to date, but we hope this will grow into a useful site with tutorials, howtos, installation notes, recipes, etc. Please contribute! Thanks to scipy.org and Enthought for hosting. http://www.scipy.org/wikis/topical_software/MatplotlibCookbook CocoaAgg: New CocoaAgg backend for native GUI on OSX, 10.3 and 10.4 compliant, contributed by Charles Moad. TeX support : Now you can (optionally) use TeX to handle all of the text elements in your figure with the rc param text.usetex in the antigrain and postscript backends; see http://www.scipy.org/wikis/topical_software/UsingTex. Thanks to Darren Dale for hard work on the TeX support. Reorganized config files: Made HOME/.matplotlib the new config dir where the matplotlibrc file, the ttf.cache, and the tex.cache live. Your .matplotlibrc file, if you have one, should be renamed to .matplotlib/matplotlibrc. Masked arrays: Support for masked arrays in line plots, pcolor and contours. Thanks Eric Firing and Jeffrey Whitaker. New image resize options interpolation options. See help(imshow) for details, particularly the interpolation, filternorm and filterrad kwargs. New values for the interp kwarg are: 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'blackman' Byte images: Much faster imaeg loading for MxNx4 or MxNx3 UInt8 images, which bypasses the memory and CPU intensive integer/floating point conversions. Thanks Nicolas Girard. Fast markers on win32: The marker cache optimization is finally available for win32, after an agg bug was found and fixed (thanks Maxim!). Line marker plots should be considerably faster now on win32. Qt in ipython/pylab: You can now use qt in ipython pylab mode. Thanks Fernando Perez and the Orsay team! Agg wrapper proper: Started work on a proper agg wrapper to expose more general agg functionality in mpl. See examples/agg_test.py. Lots of wrapping remains to be done. Subplot configuration: There is a new toolbar button on GTK*, WX* and TkAgg to launch the subplot configuration tool. GUI neutral widgets: Matplotlib now has cross-GUI widgets (buttons, check buttons, radio buttons and sliders). See examples/widgets/*.py and http://matplotlib.sf.net/screenshots.html#slider_demo. This makes it easier to create interactive figures that run across backends. Full screen mode in GTK*: Use 'f' to toggle full screen mode in the GTK backends. Thanks Steve Chaplin. Downloads available from http://matplotlib.sf.net From ryanfedora at comcast.net Tue Aug 2 14:03:04 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Tue, 02 Aug 2005 14:03:04 -0400 Subject: [SciPy-user] element by element multiplication and round off Message-ID: <42EFB558.2060804@comcast.net> I have a vector of imaginary numbers that I need to square and do somethings element-by-element. If I simply do In [55]: test=svect**2 In [56]: test[-1] Out[56]: (-96731.992735076812+1.1845861292127511e-011j) I get round off error. But if I do it element-by-element in a for loop the problem goes away: In [57]: test2=svect[-1]**2 In [58]: test2 Out[58]: (-96731.992735076812+0j) Or In [59]: sqout=[] In [60]: for ent in svect.tolist(): ....: curent=ent**2 ....: sqout.append(curent) ....: In [61]: test2=array(sqout) In [62]: test2[-1] Out[62]: (-96731.992735076812+0j) Why is this and can I get rid of the round off without having to write for loops for everything? Thanks, Ryan From vinicius.nascimento at gmail.com Tue Aug 2 16:32:02 2005 From: vinicius.nascimento at gmail.com (Vinicius Franco do Nascimento) Date: Tue, 2 Aug 2005 20:32:02 +0000 Subject: [SciPy-user] gnuplot not output image Message-ID: <62524b780508021332c5ae172@mail.gmail.com> Hi, I'm using Ubuntu Linux python 2.4 and don't plot my graphics using scipy.gplt Legend don't show too. Anyonde help me? this is my script: #!/usr/bin/python # Vinicius Franco do Nascimento # vinicius.nascimento at gmail.com # Calculo de campo usando espiras elementares # Qui 19 Mai 2005 10:30:30 UTC from montgomery import Focz from numarray import * from scipy import gplt print "######################################" print "# Calculo da Bobina Helicoidal #" print "#Vinicius Franco do Nascimento/DEMAR #" print "######################################" n=1 I=1 p=0.1 r=1 rc=0 a2=0 v=0 path=arange(0, 15, 0.05) k=0 Hz=arange(size(path))*1. for i in path: FoczObj = Focz(I, r, i, n, p, a2, v, rc) Hz[k]=FoczObj.Hz_teste() print "%f, %f" % (Hz[k], i) k+=1 gplt.plot(path, Hz) gplt.output("hz.png", 'png color') gplt.title('Campo H em Bobina Helicoidal Espessa') gplt.xtitle('Distancia x(cm)') gplt.ytitle('Hz (Gauss)') gplt.legend() -- ================================ Vin?cius Franco do Nascimento vinicius.nascimento at gmail.com http://vinicius.objectis.net/ From jdc at uwo.ca Tue Aug 2 22:27:26 2005 From: jdc at uwo.ca (Dan Christensen) Date: Tue, 02 Aug 2005 22:27:26 -0400 Subject: [SciPy-user] addition of vectors of different lengths Message-ID: <8764un69gx.fsf@uwo.ca> I've got some 1d numarrays that I'd like to add componentwise, but sometimes they differ in length. When this in the case, I'd like to imagine that the shorter one is extended by zeros. Is there a fast way to do this sort of addition? My current solution is slow, probably because of the use of concatenate: l1 = len(v1) l2 = len(v2) if l1 == l2: v = v1+v2 elif l1 < l2: v = concatenate((v1+v2[:l1], v2[l1:])) else: v = concatenate((v1[:l2]+v2, v1[l2:])) The vectors are short, typically just 10 or 20 elements, at most 256. Thanks, Dan From zhiwen.chong at elf.mcgill.ca Tue Aug 2 22:59:08 2005 From: zhiwen.chong at elf.mcgill.ca (Zhiwen Chong) Date: Tue, 2 Aug 2005 22:59:08 -0400 Subject: [SciPy-user] addition of vectors of different lengths In-Reply-To: <8764un69gx.fsf@uwo.ca> References: <8764un69gx.fsf@uwo.ca> Message-ID: Hello, On 2-Aug-05, at 10:27 PM, Dan Christensen wrote: > way to do this sort of addition? My current solution is slow, > probably because of the use of concatenate: I modified your code a little bit and profiled it: (machine iBook G4, 1GHz) from scipy import array, rand, concatenate for i in range(100): v1 = rand(230,1) v2 = rand(256,1) l1 = len(v1) l2 = len(v2) if l1 == l2: v = v1+v2 elif l1 < l2: v = concatenate((v1+v2[:l1], v2[l1:])) else: v = concatenate((v1[:l2]+v2, v1[l2:])) The first few lines of the profiler output sorted by cumtime is: ncalls tottime percall cumtime percall filename:lineno(function) 0 0 0 profile:0(profiler) 1 0 0 1.24 1.24 profile:0(execfile('test.py')) 1 0 0 1.22 1.22 :0(execfile) 55/1 0.02 0 1.22 1.22 :1(?) 1 0 0 1.22 1.22 test.py:1(?) 1 0 0 0.95 0.95 __init__.py:8(?) 2 0.03 0.015 0.77 0.385 __init__.py:2(?) 1 0.02 0.02 0.36 0.36 _nc_imports.py:3(?) 1 0 0 0.36 0.36 numerix.py:19(?) 1 0 0 0.3 0.3 limits.py:2(?) 2 0.04 0.02 0.3 0.15 machar.py:48(__init__) 1 0 0 0.3 0.3 machar.py:8(?) 27 0 0 0.28 0.01 ppimport.py:127(ppimport) 200 0 0 0.26 0.001 ppimport.py:114(__call__) 2028 0.07 0 0.24 0 numerix.py:76(any) 2 0.02 0.01 0.22 0.11 __init__.py:5(?) 27 0.01 0 0.22 0.008 ppimport.py:35(_get_so_ext) 57/55 0 0 0.21 0.004 :0(getattr) The concatenate function seems to be all the way down here: 100 0.01 0 0.01 0 Numeric.py:231(concatenate) Maybe you could write a routine that does specifically what you want in Fortran, and wrap it with F2PY? http://cens.ioc.ee/projects/f2py2e/#usage Zhiwen -- "If the women don't find you handsome, they should at least find you handy." - Red Green From jdc at uwo.ca Wed Aug 3 00:00:45 2005 From: jdc at uwo.ca (Dan Christensen) Date: Wed, 03 Aug 2005 00:00:45 -0400 Subject: [SciPy-user] addition of vectors of different lengths In-Reply-To: References: <8764un69gx.fsf@uwo.ca> Message-ID: <87ll3j4qky.fsf@uwo.ca> Here's a bit more information to make my question more specific. Compare the following: from numarray import * import operator def addarray(v1, v2): '''Add two numarrays componentwise, extending by zero if necessary.''' l1 = len(v1) l2 = len(v2) if l1 == l2: v = v1+v2 elif l1 < l2: v = concatenate((v1+v2[:l1], v2[l1:])) else: v = concatenate((v1[:l2]+v2, v1[l2:])) def addlist(v1, v2): '''Add two lists componentwise, extending by zero if necessary.''' l1 = len(v1) l2 = len(v2) if l1 == l2: v = map(operator.add, v1, v2) elif l1 < l2: v = map(operator.add, v1, v2[:l1])+v2[l1:] else: v = map(operator.add, v1[:l2], v2)+v1[l2:] l1=range(236) a1=array(l1) l2=range(256) a2=array(l2) addarray(a1, a2) 126 usec addarray(a2, a2) 20 usec addlist(l1, l2) 96.2 usec addlist(l2, l2) 95.8 usec I'd like the speed of numarray for equal length addition combined with the way addlist doesn't get much slower with unequal lengths. Dan From elcorto at gmx.net Wed Aug 3 03:14:11 2005 From: elcorto at gmx.net (Steve Schmerler) Date: Wed, 03 Aug 2005 09:14:11 +0200 Subject: [SciPy-user] element by element multiplication and round off In-Reply-To: <42EFB558.2060804@comcast.net> References: <42EFB558.2060804@comcast.net> Message-ID: <42F06EC3.10102@gmx.net> Ryan Krauss wrote: > I have a vector of imaginary numbers that I need to square and do > somethings element-by-element. If I simply do > In [55]: test=svect**2 > In [56]: test[-1] > Out[56]: (-96731.992735076812+1.1845861292127511e-011j) > I get round off error. > > But if I do it element-by-element in a for loop the problem goes away: > In [57]: test2=svect[-1]**2 > In [58]: test2 > Out[58]: (-96731.992735076812+0j) > > Or > In [59]: sqout=[] > > In [60]: for ent in svect.tolist(): > ....: curent=ent**2 > ....: sqout.append(curent) > ....: > In [61]: test2=array(sqout) > > In [62]: test2[-1] > Out[62]: (-96731.992735076812+0j) > > Why is this and can I get rid of the round off without having to write > for loops for everything? > > Thanks, > > Ryan > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > Hi This seems to be because **2 is done by Numeric while **2 is not. In [32]: import Numeric as N In [34]: a=N.array([3.0j,4.0j]) In [35]: a Out[35]: array([ 0.+3.j, 0.+4.j]) In [36]: a**2 Out[36]: array([ -9.+1.10214572e-015j, -16.+1.95937017e-015j]) In [37]: a[0]**2 Out[37]: (-9+0j) In [38]: N.power(a[0],2.0) Out[38]: (-9+1.1021457184401395e-015j) Numeric uses C internally and therefore you are limited to double. Though I'm not an expert and I don't know what Python really does different Numeric when you say a[0]**2 cheers, steve -- Women are like cell phones. They like to be held and talked to, but push the wrong button, and you'll be disconnected. From rkern at ucsd.edu Wed Aug 3 03:32:47 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 03 Aug 2005 00:32:47 -0700 Subject: [SciPy-user] element by element multiplication and round off In-Reply-To: <42EFB558.2060804@comcast.net> References: <42EFB558.2060804@comcast.net> Message-ID: <42F0731F.7040102@ucsd.edu> Ryan Krauss wrote: > I have a vector of imaginary numbers that I need to square and do > somethings element-by-element. If I simply do > In [55]: test=svect**2 > In [56]: test[-1] > Out[56]: (-96731.992735076812+1.1845861292127511e-011j) > I get round off error. > > But if I do it element-by-element in a for loop the problem goes away: > In [57]: test2=svect[-1]**2 > In [58]: test2 > Out[58]: (-96731.992735076812+0j) > > Or > In [59]: sqout=[] > > In [60]: for ent in svect.tolist(): > ....: curent=ent**2 > ....: sqout.append(curent) > ....: > In [61]: test2=array(sqout) > > In [62]: test2[-1] > Out[62]: (-96731.992735076812+0j) > > Why is this and can I get rid of the round off without having to write > for loops for everything? Python's complex object special-cases integer exponents by strength reduction if the exponent < 100. Numeric does not. You can use Scipy's real_if_close() to get the real component iff the imaginary part is close to zero (within +-1e-13 of 0 by default) and return the full array otherwise. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From aurelien.gourrier at free.fr Wed Aug 3 04:45:41 2005 From: aurelien.gourrier at free.fr (aurelien.gourrier at free.fr) Date: Wed, 03 Aug 2005 10:45:41 +0200 Subject: [SciPy-user] Pb building Atlas library: target pattern contains no '%' In-Reply-To: <20050803061506.CBBE03EB91@www.scipy.com> References: <20050803061506.CBBE03EB91@www.scipy.com> Message-ID: <1123058741.42f08435bfb99@imp1-q.free.fr> Dear all, Really sorry to be bothering with this since there seems to be already a lot of mails on this topic but I just can't find the solution... I'm trying to build Scipy under WinXp for python2.4. I followed the instructions on http://www.scipy.org/documentation/buildscipywin32.txt and http://www.scipy.org/documentation/buildatlas4scipywin32.txt but I get blocked when building the Atlas library... After doing the following in a Cygwin shell : > make xconfig > export ARCH=WinNT_P4SSE2 I changed to the following lines in Make.WinNT_P4SSE2 F77 = $(MINGW_PREFIX)/bin/g77.exe F77FLAGS = -fomit-frame-pointer -O -fno-second-underscore GCCdir = $(MINGW_PREFIX)/bin GOODGCC = $(MINGW_PREFIX)/bin/gcc.exe CC = $(MINGW_PREFIX)/bin/gcc.exe MCC = $(MINGW_PREFIX)/bin/gcc.exe BLASlib = c:/cygwin/$(BLAS) RANLIB = ranlib and then typed > make install arch=$ARCH and I get the following error at step 2: Makefile:12 *** target pattern contains no '%'. Stop. I looked up in the Makefile and this is what I have: SHELL = /bin/sh CC = gcc NM = -o OJ = -c config: xconfig ./xconfig rm -f ./xconfig DoNothing: searchconf: $(CC) -DForceSearch -o xconfig config.c ./xconfig rm -f ./xconfig xconfig : config.c $(CC) -o xconfig config.c xatlas_tee : bin/atlas_tee.c $(CC) -o xatlas_tee bin/atlas_tee.c error_report: $(MAKE) -f Make.top error_report arch=$(arch) ... I really don't uderstand why I'm getting this error, does anyone have an idea ? Thanks, Aure From rkern at ucsd.edu Wed Aug 3 04:51:21 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 03 Aug 2005 01:51:21 -0700 Subject: [SciPy-user] Pb building Atlas library: target pattern contains no '%' In-Reply-To: <1123058741.42f08435bfb99@imp1-q.free.fr> References: <20050803061506.CBBE03EB91@www.scipy.com> <1123058741.42f08435bfb99@imp1-q.free.fr> Message-ID: <42F08589.3030707@ucsd.edu> aurelien.gourrier at free.fr wrote: > Dear all, > > Really sorry to be bothering with this since there seems to be already a lot of > mails on this topic but I just can't find the solution... > > I'm trying to build Scipy under WinXp for python2.4. I followed the instructions > on http://www.scipy.org/documentation/buildscipywin32.txt and > http://www.scipy.org/documentation/buildatlas4scipywin32.txt but I get blocked > when building the Atlas library... [snip] > I really don't uderstand why I'm getting this error, does anyone have an idea ? Not really, but have you tried using the ATLAS binaries? http://www.scipy.org/download/atlasbinaries/ -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From aurelien.gourrier at free.fr Wed Aug 3 09:00:18 2005 From: aurelien.gourrier at free.fr (aurelien.gourrier at free.fr) Date: Wed, 03 Aug 2005 15:00:18 +0200 Subject: [SciPy-user] Pb building Atlas library: target pattern contains no '%' In-Reply-To: <42F08589.3030707@ucsd.edu> References: <20050803061506.CBBE03EB91@www.scipy.com> <1123058741.42f08435bfb99@imp1-q.free.fr> <42F08589.3030707@ucsd.edu> Message-ID: <1123074018.42f0bfe2b0e68@imp1-q.free.fr> > [snip] > > I really don't uderstand why I'm getting this error, does anyone have an > idea ? > > Not really, but have you tried using the ATLAS binaries? > > http://www.scipy.org/download/atlasbinaries/ > > -- > Robert Kern > rkern at ucsd.edu > I was about to... but I still would have liked to understand where this error comes from... well, I guess life is full of frustration anyhow... ;-) Thanks again, Aure From jdc at uwo.ca Wed Aug 3 10:11:37 2005 From: jdc at uwo.ca (Dan Christensen) Date: Wed, 03 Aug 2005 10:11:37 -0400 Subject: [SciPy-user] addition of vectors of different lengths In-Reply-To: <87ll3j4qky.fsf@uwo.ca> References: <8764un69gx.fsf@uwo.ca> <87ll3j4qky.fsf@uwo.ca> Message-ID: <87d5ov3yau.fsf@uwo.ca> One solution to my problem is to use Numeric instead of numarray. Here's some more timing information (2GHz, P4 laptop). First I'll repeat the previous info, which was with python 2.4 and numarray 1.3.3: addarray(a1, a2) 126 usec addarray(a2, a2) 20 usec addlist(l1, l2) 96.2 usec addlist(l2, l2) 95.8 usec Here is python 2.4 with Numeric 23.8: addarray(a1, a2) 15 usec addarray(a2, a2) 4.6 usec So even when concatenation is needed, Numeric beats numarray! It'd be nice to understand my numarray does so poorly at this. For kicks, I tried using weave.inline with Numeric, and that took about 30 usec in both cases. If I knew more about Numeric's C API, I could probably do better, but 15 usec is pretty good and I prefer a pure python solution. As a general question, I wonder if it would be reasonable to allow ufuncs to be applied to arrays of different sizes. When one of the arrays is missing data, the ufunc could be given None for that argument, and decide whether to raise an exception or to use a default value. Is this something that was thought about but not done for some reason? Dan ----- For the tests above, I used: #from numarray import * from Numeric import * def addarray(v1, v2): l1 = len(v1) l2 = len(v2) if l1 == l2: v = v1+v2 elif l1 < l2: v = concatenate((v1+v2[:l1], v2[l1:])) else: v = concatenate((v1[:l2]+v2, v1[l2:])) return v def addlist(v1, v2): l1 = len(v1) l2 = len(v2) if l1 == l2: v = map(operator.add, v1, v2) elif l1 < l2: v = map(operator.add, v1, v2[:l1])+v2[l1:] else: v = map(operator.add, v1[:l2], v2)+v1[l2:] return v import weave def addarrayinline(v1, v2): l1 = len(v1) l2 = len(v2) lm = min(l1,l2) l = max(l1,l2) v = zeros(l) code = """ for(int i=0; i References: <8764un69gx.fsf@uwo.ca> <87ll3j4qky.fsf@uwo.ca> <87d5ov3yau.fsf@uwo.ca> Message-ID: <42F10447.9070101@ee.byu.edu> >As a general question, I wonder if it would be reasonable to allow >ufuncs to be applied to arrays of different sizes. When one of the >arrays is missing data, the ufunc could be given None for that >argument, and decide whether to raise an exception or to use a default >value. Is this something that was thought about but not done for >some reason? > > I have not been following this entire discussion, but this kind of behavior would markedly change the current rules and make ufuncs slower in general. Now, I suppose instead of raising a shape-mismatch error an alternative algorithm could be called, that would fix the speed problem, but it would still mean that unintentional shape mismatch bugs would be hard to catch. It's an interesting propostion though. -Travis From guillem at torroja.dmt.upm.es Wed Aug 3 21:13:03 2005 From: guillem at torroja.dmt.upm.es (guillem at torroja.dmt.upm.es) Date: Thu, 4 Aug 2005 03:13:03 +0200 (CEST) Subject: [SciPy-user] gnuplot not output image In-Reply-To: <62524b780508021332c5ae172@mail.gmail.com> References: <62524b780508021332c5ae172@mail.gmail.com> Message-ID: > gplt.plot(path, Hz) > gplt.output("hz.png", 'png color') > gplt.title('Campo H em Bobina Helicoidal Espessa') > gplt.xtitle('Distancia x(cm)') > gplt.ytitle('Hz (Gauss)') > gplt.legend() > try gplt.plot(path, Hz) gplt.xtitle(----) gplt.ytitle(----) gplt.legend() gplt.output('hz.png','png') I am using kubuntu and this works for me png terminal is colored so there's no need to use png color, and png color has never worked fine in my computer you must call the output function at the end because gnuplot doesn't refresh the png automatically. Cheers __________________________________ Guillem Borrell Nogueras guillem_at_torroja.dmt.upm.es guillemborrell_at_gmail.com http://torroja.dmt.upm.es/~guillem/ From jdc at uwo.ca Thu Aug 4 00:46:58 2005 From: jdc at uwo.ca (Dan Christensen) Date: Thu, 04 Aug 2005 00:46:58 -0400 Subject: [SciPy-user] addition of vectors of different lengths In-Reply-To: <42F10447.9070101@ee.byu.edu> References: <8764un69gx.fsf@uwo.ca> <87ll3j4qky.fsf@uwo.ca> <87d5ov3yau.fsf@uwo.ca> <42F10447.9070101@ee.byu.edu> Message-ID: <871x5a48cd.fsf@uwo.ca> Travis Oliphant writes: >> As a general question, I wonder if it would be reasonable to allow >> ufuncs to be applied to arrays of different sizes. When one of the >> arrays is missing data, the ufunc could be given None for that >> argument, and decide whether to raise an exception or to use a default >> value. Is this something that was thought about but not done for >> some reason? > > I have not been following this entire discussion, but this kind of > behavior would markedly change the current rules and make ufuncs slower > in general. Yes, I agree that it wouldn't be good to change this by default. > Now, I suppose instead of raising a shape-mismatch error an alternative > algorithm could be called, that would fix the speed problem, but it > would still mean that unintentional shape mismatch bugs would be hard to > catch. > > It's an interesting propostion though. I wonder about a couple of options. One would be to provide a function like call_ufunc_with_default(add, default=0.0, a, b) This would be the same as add(a,b), except that the result would have its size in the ith dimension equal to the maximum of the sizes of a and b in the ith dimension, and when values aren't present from a or b, the value 0.0 would be passed to add. The hope would be that this could be implemented at a low enough level that it's quite fast. A second possibility would be to provide a function like reshape or resize which allowed one to extend an array by zeros in some dimensions. This seems like a useful thing to have in general, but (I assume that) data would have to be copied around, so it would be slower to do add(extend_a_with_zeros(a, b.getshape()), b) than call_ufunc_with_defaults(add, default=0.0, a, b) Dan From jdc at uwo.ca Thu Aug 4 00:51:09 2005 From: jdc at uwo.ca (Dan Christensen) Date: Thu, 04 Aug 2005 00:51:09 -0400 Subject: [SciPy-user] finding approximate rank of matrix Message-ID: <87wtn22tky.fsf@uwo.ca> Suppose you have 300 vectors each with 64 components, and you want to find the smallest subspace of R^64 that they all lie in. That would just be the rank of the 300x64 matrix that they form. But unfortunately the vectors are generated numerically to low precision (maybe 1e-5 relative error?). So taken literally, they will span R^64. I'd like to find the smallest subspace of R^64 that they all approximately lie in, with a specified tolerance. Is there an easy way to do this? Thanks, Dan From rkern at ucsd.edu Thu Aug 4 00:58:36 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 03 Aug 2005 21:58:36 -0700 Subject: [SciPy-user] finding approximate rank of matrix In-Reply-To: <87wtn22tky.fsf@uwo.ca> References: <87wtn22tky.fsf@uwo.ca> Message-ID: <42F1A07C.1040706@ucsd.edu> Dan Christensen wrote: > Suppose you have 300 vectors each with 64 components, and you want to > find the smallest subspace of R^64 that they all lie in. That would > just be the rank of the 300x64 matrix that they form. But > unfortunately the vectors are generated numerically to low precision > (maybe 1e-5 relative error?). So taken literally, they will span > R^64. I'd like to find the smallest subspace of R^64 that they all > approximately lie in, with a specified tolerance. > > Is there an easy way to do this? To find the nullspace: def null(A, eps=1e-16): u, s, vh = scipy.linalg.svd(A) mask = (s/s[0] <= eps) rowspace = scipy.compress(mask, vh, axis=0) return scipy.conjugate(scipy.transpose(rowspace)) Doing the converse to find the spanned subspace is an exercise left to the reader. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From s.olsen1 at uq.edu.au Thu Aug 4 01:38:03 2005 From: s.olsen1 at uq.edu.au (Dr Seth OLSEN) Date: Thu, 04 Aug 2005 15:38:03 +1000 Subject: [SciPy-user] finding approximate rank of matrix Message-ID: <3a9123da97.3da973a912@uq.edu.au> Hi Dan, You should be able to do this with a singular value decomposition. The singular values will tell you the projection along each corresponding vector. Choose a threshold for the singular value and take the vectors corresponding to values above that - these should define your subspace. Cheers, Seth ccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccms Dr Seth Olsen, PhD Postdoctoral Fellow, Biomolecular Modeling Group Centre for Computational Molecular Science Chemistry Building, The University of Queensland Qld 4072, Brisbane, Australia tel (617) 33653732 fax (617) 33654623 email: s.olsen1 at uq.edu.au Web: www.ccms.uq.edu.au ccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccms ----- Original Message ----- From: Dan Christensen Date: Thursday, August 4, 2005 2:51 pm Subject: [SciPy-user] finding approximate rank of matrix > Suppose you have 300 vectors each with 64 components, and you want to > find the smallest subspace of R^64 that they all lie in. That would > just be the rank of the 300x64 matrix that they form. But > unfortunately the vectors are generated numerically to low precision > (maybe 1e-5 relative error?). So taken literally, they will span > R^64. I'd like to find the smallest subspace of R^64 that they all > approximately lie in, with a specified tolerance. > > Is there an easy way to do this? > > Thanks, > > Dan > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From abli at freemai.hu Thu Aug 4 13:26:12 2005 From: abli at freemai.hu (Abel Daniel) Date: Thu, 04 Aug 2005 19:26:12 +0200 Subject: [SciPy-user] reporting bugs (about raising exceptions in weave'd code) Message-ID: Hi! What is the preferred way of reporting bugs? I tried to submit one about a week ago, by using the bugtracker at http://www.scipy.net/roundup/scipy/index (the bug is no. 240, at http://www.scipy.net/roundup/scipy/issue240) but I'm not sure it got any attention. Am I following the right procedure? -- Abel Daniel http://abeld.web.elte.hu/ From jdc at uwo.ca Thu Aug 4 17:23:54 2005 From: jdc at uwo.ca (Dan Christensen) Date: Thu, 04 Aug 2005 17:23:54 -0400 Subject: [SciPy-user] finding approximate rank of matrix In-Reply-To: <42F1A07C.1040706@ucsd.edu> References: <87wtn22tky.fsf@uwo.ca> <42F1A07C.1040706@ucsd.edu> Message-ID: <87u0i55rbp.fsf@uwo.ca> Thanks, the singular value decomposition is exactly what I need! Dan From alan.curtis at gmail.com Fri Aug 5 13:54:34 2005 From: alan.curtis at gmail.com (Alan Curtis) Date: Fri, 5 Aug 2005 13:54:34 -0400 Subject: [SciPy-user] Installing SciPy on OS X Message-ID: I would like to install SciPy on OS X 10.4.2. I have read http://www.scipy.org/documentation/Members/fonnesbeck/osx_build.txt and recent posts on this list http://www.scipy.net/pipermail/scipy-user/2005-June/004555.html I got to the point of building SciPy which fails with the same error as this last post. The solution seems to be to use the CVS version, but I cannot get that as CVS isn't working cvs [login aborted]: connect to scipy.org(216.62.213.228):2401 failed: Connection refused Is there another way? Alan From jdgleeson at mac.com Fri Aug 5 16:02:29 2005 From: jdgleeson at mac.com (John Gleeson) Date: Fri, 5 Aug 2005 14:02:29 -0600 Subject: [SciPy-user] Installing SciPy on OS X In-Reply-To: References: Message-ID: On Aug 5, 2005, at 11:54 AM, Alan Curtis wrote: > I got to the point of building SciPy which fails with the same > error as this last post. The solution seems to be to use the CVS > version, but I cannot get that as CVS isn't working > > cvs [login aborted]: connect to scipy.org(216.62.213.228):2401 > failed: Connection refused > > Is there another way? > > Alan > http://www.scipy.net/pipermail/scipy-user/2005-July/004928.html From smaret at umich.edu Sat Aug 6 16:26:14 2005 From: smaret at umich.edu (=?ISO-8859-1?Q?S=E9bastien_Maret?=) Date: Sat, 6 Aug 2005 16:26:14 -0400 Subject: [SciPy-user] Installing SciPy on OS X In-Reply-To: References: Message-ID: On Aug 5, 2005, at 13:54, Alan Curtis wrote: > I would like to install SciPy on OS X 10.4.2. I have read > > http://www.scipy.org/documentation/Members/fonnesbeck/osx_build.txt > > and recent posts on this list > > http://www.scipy.net/pipermail/scipy-user/2005-June/004555.html > > I got to the point of building SciPy which fails with the same > error as this last post. The solution seems to be to use the CVS > version, but I cannot get that as CVS isn't working > > cvs [login aborted]: connect to scipy.org(216.62.213.228):2401 > failed: Connection refused > > Is there another way? You can use Fink: http://fink.sourceforge.net/pdb/package.php/scipy-py24 S?bastien From joe at enthought.com Mon Aug 8 02:25:12 2005 From: joe at enthought.com (Joe Cooper) Date: Mon, 08 Aug 2005 01:25:12 -0500 Subject: [SciPy-user] Subversion migration complete Message-ID: <42F6FAC8.4010709@enthought.com> Hi all, I've just completed the long-threatened migration of all of the scipy CVS repositories to Subversion on the new server. All future work will be done in the Subversion repositories. Here are the repository paths: http://svn.scipy.org/svn/scipy/ http://svn.scipy.org/svn/agg2/ http://svn.scipy.org/svn/chaco-1.0/ (Historical only. Do not use.) http://svn.scipy.org/svn/kiva-1.0/ (Historical only. Do not use.) http://svn.scipy.org/svn/fftw_win32/ http://svn.scipy.org/svn/freetype2/ http://svn.scipy.org/svn/PyCrust/ http://svn.scipy.org/svn/traits-1.0/ (Historical only. Do not use.) http://svn.scipy.org/svn/xml_installer/ All but the scipy repository have questionable lineage--i.e., either I don't know what they are used for or who is maintaining them (PyCrust, agg2, fftw_win32, freetype2) or I know that they are not being maintained and will never be maintained in their current form and shouldn't be used under any circumstance I can think of (chaco, kiva, traits which are part of the Enthought OSS tool suite and now live at http://code.enthought.com or xml_installer which is currently unmaintained, but some of it will find its way into the Enthon project before too long). The repositories existed on the old scipy.org, and so they came on over to the new scipy.org. I welcome input about what the repositories that are unknown to me actually are. freetype2 is a double mystery in that there were two freetype2 CVS repositories...if you are in a position to know whether I got the right one, I'd appreciate a note to that effect. Commit privileges will be restored in the next hour or so. If you find by tomorrow that you no longer have commit privileges to repositories that you work on, please let me know. I'm sure people will get missed during this process, as security is much tighter on the new server, and not all users on the old server are coming over. Please let me know if you see any problems in the migrated repositories. Documentation on the website will be updated shortly to reflect the changes. From nwagner at mecha.uni-stuttgart.de Mon Aug 8 07:02:08 2005 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon, 08 Aug 2005 13:02:08 +0200 Subject: [SciPy-user] Command Line SVN Instructions Message-ID: <42F73BB0.5090909@mecha.uni-stuttgart.de> Hi all, How do I use svn to install scipy ? The usage of the former cvs access is well documented http://www.scipy.org/cvs/. Is there a similar page for svn ? Nils From d.howey at imperial.ac.uk Mon Aug 8 07:12:48 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Mon, 8 Aug 2005 12:12:48 +0100 Subject: [SciPy-user] Array functions Message-ID: <056D32E9B2D93B49B01256A88B3EB218766E8B@icex2.ic.ac.uk> I guess this is a numpy question, but how do I do truth tests on arrays? I'm trawling around the documentation but struggling to find an answer.. I want to test if any array contains ONLY zeros. Originally I had: if a == 0: # code in here I need this to be true both for a = 0 # ie a is just a number and for a = array((0,0,0,0,0)) It must return false for any array with any nonzero elements anywhere At the moment python does this (which is wrong): >>> vin = array((1.,0,0)) >>> vin array([ 1., 0., 0.]) >>> if vin == 0: print "yes" yes >>> Thanks Dave From rkern at ucsd.edu Mon Aug 8 07:21:19 2005 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 08 Aug 2005 04:21:19 -0700 Subject: [SciPy-user] Array functions In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766E8B@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766E8B@icex2.ic.ac.uk> Message-ID: <42F7402F.8040004@ucsd.edu> Howey, David A wrote: > I guess this is a numpy question, but how do I do truth tests on arrays? > I'm trawling around the documentation but struggling to find an answer.. > > I want to test if any array contains ONLY zeros. > > Originally I had: > if a == 0: > # code in here > > I need this to be true both for > a = 0 # ie a is just a number > > and for > a = array((0,0,0,0,0)) > > It must return false for any array with any nonzero elements anywhere In [1]: a = array((0,0,0,0,0)) In [2]: alltrue(a == 0) Out[2]: 1 In [3]: a == 0 Out[3]: array([1, 1, 1, 1, 1],'b') In [4]: a[1] = 10 In [5]: alltrue(a == 0) Out[5]: 0 In [6]: a == 0 Out[6]: array([1, 0, 1, 1, 1],'b') There's also a sometrue() function, too. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From ckkart at hoc.net Mon Aug 8 07:27:02 2005 From: ckkart at hoc.net (Christian Kristukat) Date: Mon, 08 Aug 2005 13:27:02 +0200 Subject: [SciPy-user] Array functions In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766E8B@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766E8B@icex2.ic.ac.uk> Message-ID: <42F74186.2020801@hoc.net> Howey, David A wrote: > I guess this is a numpy question, but how do I do truth tests on arrays? > I'm trawling around the documentation but struggling to find an answer.. > > I want to test if any array contains ONLY zeros. > > Originally I had: > if a == 0: > # code in here > > I need this to be true both for > a = 0 # ie a is just a number > > and for > a = array((0,0,0,0,0)) Have a look at sometrue/alltrue: e.g. alltrue(a==0.0) returns True if all elements are zero. Christian From w.northcott at unsw.edu.au Mon Aug 8 08:06:08 2005 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Mon, 8 Aug 2005 22:06:08 +1000 Subject: [SciPy-user] Installing SciPy on OS X In-Reply-To: <20050808101310.8C2213EB5A@www.scipy.com> References: <20050808101310.8C2213EB5A@www.scipy.com> Message-ID: <11077F9B-0A9E-4202-B633-36BF1A50EF6A@unsw.edu.au> On 08/08/2005, at 8:13 PM, Alan Curtis wrote: > I got to the point of building SciPy which fails with the same error > as this last post. The solution seems to be to use the CVS version, > but I cannot get that as CVS isn't working > > cvs [login aborted]: connect to scipy.org(216.62.213.228):2401 > failed: Connection refused > > Is there another way? > According to this the subversion access is now working http://www.scipy.net/pipermail/scipy-dev/2005-August/003097.html Also there was very recent code which I know works on MacOS X here http://ipython.scipy.org/tmp/scipy_cvs_2005-07-29.tgz but that may have been taken down now that Subversion is working. Bill Northcott From rkern at ucsd.edu Mon Aug 8 08:13:44 2005 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 08 Aug 2005 05:13:44 -0700 Subject: [SciPy-user] Installing SciPy on OS X In-Reply-To: <11077F9B-0A9E-4202-B633-36BF1A50EF6A@unsw.edu.au> References: <20050808101310.8C2213EB5A@www.scipy.com> <11077F9B-0A9E-4202-B633-36BF1A50EF6A@unsw.edu.au> Message-ID: <42F74C78.7070102@ucsd.edu> Bill Northcott wrote: > On 08/08/2005, at 8:13 PM, Alan Curtis wrote: > >> I got to the point of building SciPy which fails with the same error >> as this last post. The solution seems to be to use the CVS version, >> but I cannot get that as CVS isn't working >> >> cvs [login aborted]: connect to scipy.org(216.62.213.228):2401 >> failed: Connection refused >> >> Is there another way? >> > According to this the subversion access is now working > http://www.scipy.net/pipermail/scipy-dev/2005-August/003097.html > > Also there was very recent code which I know works on MacOS X here > http://ipython.scipy.org/tmp/scipy_cvs_2005-07-29.tgz > but that may have been taken down now that Subversion is working. Note that, at the moment, the SVN repository is still missing scipy_core which has necessary componenents, so please use the snapshot for now. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From travis at enthought.com Mon Aug 8 09:18:51 2005 From: travis at enthought.com (Travis N. Vaught) Date: Mon, 08 Aug 2005 08:18:51 -0500 Subject: [SciPy-user] Command Line SVN Instructions In-Reply-To: <42F73BB0.5090909@mecha.uni-stuttgart.de> References: <42F73BB0.5090909@mecha.uni-stuttgart.de> Message-ID: <42F75BBB.8070709@enthought.com> Hey Nils, I'll get the site updated today to reflect the proper svn instructions. Currently scipy_core is MIA, so we're not quite finished with the migration. When we are ready, the quick instructions should be: If you don't already have it, get the subversion command line app from: http://subversion.tigris.org and run (on windows): C:\temp>mkdir scipy C:\temp>svn co http://svn.scipy.org/svn/scipy/trunk .\scipy ...then to update, navigate the checkout dir and... svn up There is not currently a 'scipy' subdirectory under trunk, so you'll probably want to contain the checkout in a 'scipy' directory. Nils Wagner wrote: > Hi all, > > How do I use svn to install scipy ? > The usage of the former cvs access is well documented > http://www.scipy.org/cvs/. > Is there a similar page for svn ? > > Nils > > > > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- ........................ Travis N. Vaught CEO Enthought, Inc. http://www.enthought.com ........................ From jdc at uwo.ca Mon Aug 8 10:21:54 2005 From: jdc at uwo.ca (Dan Christensen) Date: Mon, 08 Aug 2005 10:21:54 -0400 Subject: [SciPy-user] Array functions In-Reply-To: <42F7402F.8040004@ucsd.edu> References: <056D32E9B2D93B49B01256A88B3EB218766E8B@icex2.ic.ac.uk> <42F7402F.8040004@ucsd.edu> Message-ID: <87vf2gtsot.fsf@uwo.ca> Robert Kern writes: > Howey, David A wrote: > >> I want to test if any array contains ONLY zeros. > > In [1]: a = array((0,0,0,0,0)) > > In [2]: alltrue(a == 0) > > There's also a sometrue() function, too. Some curious timing info for v=array([1]+[0]*32+[1]), python 2.4: Numeric 23.8 numarray 1.3.3 innerproduct(v,v)!=0.0 16 usec 5 usec sometrue(v) 8 usec 84 usec alltrue(v==0.0) 21 usec 50 usec So with both Numeric and numarray, alltrue is not the best option. But whether innerproduct or sometrue is best depends strongly on which package you are using. The 84 usec result for numarray is a bit shocking, considering that it can compute the innerproduct in 5 usec. Similar timing results happen for other arrays; I believe that neither alltrue nor sometrue use short-circuit logic, so they examine all the elements even if the truth value is clear from an initial subsequence. I also am in the position that I often need to know whether an array is completely zero, so I'd find a version of sometrue which short-circuits quite useful. Dan From Fernando.Perez at colorado.edu Mon Aug 8 13:10:56 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Mon, 08 Aug 2005 11:10:56 -0600 Subject: [SciPy-user] Installing SciPy on OS X In-Reply-To: <42F74C78.7070102@ucsd.edu> References: <20050808101310.8C2213EB5A@www.scipy.com> <11077F9B-0A9E-4202-B633-36BF1A50EF6A@unsw.edu.au> <42F74C78.7070102@ucsd.edu> Message-ID: <42F79220.1020200@colorado.edu> Robert Kern wrote: > Bill Northcott wrote: >>Also there was very recent code which I know works on MacOS X here >>http://ipython.scipy.org/tmp/scipy_cvs_2005-07-29.tgz >>but that may have been taken down now that Subversion is working. > > > Note that, at the moment, the SVN repository is still missing scipy_core > which has necessary componenents, so please use the snapshot for now. There's no reason for me to remove that snapshot, so I'll leave it up until we're 100% sure that the svn repo is fully operational. Cheers, f From d.howey at imperial.ac.uk Tue Aug 9 06:32:53 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Tue, 9 Aug 2005 11:32:53 +0100 Subject: [SciPy-user] root finding Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E70A@icex2.ic.ac.uk> Hi, I am pondering the best way to do some root finding. I have a function which I give a mass flow value to and it returns a pressure. I need to iterate the mass flow value until a specific pressure is reached. As long as sensible initial guess are chosen, the function produces a pretty smooth curve with a unique root. Initially I had a rough and ready algorithm which shoved a range of mass flows (in an array) through the function and looked for a zero crossing, and then fine tuned the result a few times. This works, but I'm wondering whether something like Newton-Raphson would be better, although I don't directly know the derivative, so I would be using a numerical approximation (I think this is called the secant method). Does scipy have an implementation of this? Any tips for use? Thanks Dave -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3537 bytes Desc: not available URL: From d.howey at imperial.ac.uk Tue Aug 9 06:38:49 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Tue, 9 Aug 2005 11:38:49 +0100 Subject: [SciPy-user] RE: root finding Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E70B@icex2.ic.ac.uk> oops, should have checked out the documentation, there is something called 'newton' in the optimize package. Still, I would appreciate any tips for use. ________________________________ From: scipy-user-bounces at scipy.net on behalf of Howey, David A Sent: Tue 09/08/2005 11:32 To: SciPy Users List Subject: root finding Hi, I am pondering the best way to do some root finding. I have a function which I give a mass flow value to and it returns a pressure. I need to iterate the mass flow value until a specific pressure is reached. As long as sensible initial guess are chosen, the function produces a pretty smooth curve with a unique root. Initially I had a rough and ready algorithm which shoved a range of mass flows (in an array) through the function and looked for a zero crossing, and then fine tuned the result a few times. This works, but I'm wondering whether something like Newton-Raphson would be better, although I don't directly know the derivative, so I would be using a numerical approximation (I think this is called the secant method). Does scipy have an implementation of this? Any tips for use? Thanks Dave -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4077 bytes Desc: not available URL: From nwagner at mecha.uni-stuttgart.de Tue Aug 9 08:05:35 2005 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 09 Aug 2005 14:05:35 +0200 Subject: [SciPy-user] RE: root finding In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E70B@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E70B@icex2.ic.ac.uk> Message-ID: <42F89C0F.5060707@mecha.uni-stuttgart.de> Howey, David A wrote: >oops, should have checked out the documentation, there is something called 'newton' in the optimize package. Still, I would appreciate any tips for use. > > A small example is given below: from scipy import * from pylab import * data = [] def func(x): global data data.append(x) return x**2+x-2 x0 = -1.5 root = optimize.newton(func, x0, fprime=None, args=(), tol=1.48e-08, maxiter=50) plot(range(len(data)),data) xlabel('Iteration') show() Nils >________________________________ > >From: scipy-user-bounces at scipy.net on behalf of Howey, David A >Sent: Tue 09/08/2005 11:32 >To: SciPy Users List >Subject: root finding > > >Hi, > >I am pondering the best way to do some root finding. I have a function which I give a mass flow value to and it returns a pressure. I need to iterate the mass flow value until a specific pressure is reached. As long as sensible initial guess are chosen, the function produces a pretty smooth curve with a unique root. > >Initially I had a rough and ready algorithm which shoved a range of mass flows (in an array) through the function and looked for a zero crossing, and then fine tuned the result a few times. This works, but I'm wondering whether something like Newton-Raphson would be better, although I don't directly know the derivative, so I would be using a numerical approximation (I think this is called the secant method). Does scipy have an implementation of this? Any tips for use? > >Thanks > >Dave > > >------------------------------------------------------------------------ > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > From oliphant at ee.byu.edu Tue Aug 9 11:32:37 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 09 Aug 2005 09:32:37 -0600 Subject: [SciPy-user] root finding In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E70A@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E70A@icex2.ic.ac.uk> Message-ID: <42F8CC95.3010500@ee.byu.edu> Howey, David A wrote: >Hi, > >I am pondering the best way to do some root finding. I have a function which I give a mass flow value to and it returns a pressure. I need to iterate the mass flow value until a specific pressure is reached. As long as sensible initial guess are chosen, the function produces a pretty smooth curve with a unique root. > >Initially I had a rough and ready algorithm which shoved a range of mass flows (in an array) through the function and looked for a zero crossing, and then fine tuned the result a few times. This works, but I'm wondering whether something like Newton-Raphson would be better, although I don't directly know the derivative, so I would be using a numerical approximation (I think this is called the secant method). Does scipy > >have an implementation of this? Any tips for use? > > Chuck Harris contributed some fantastic 1-dimensional root finding algorithms based on the secant method (as you correctly identified). I recommend trying out scipy.optimize.brenth and friends. See the docstring for scipy.optimize under the "scalar function solvers" heading scipy.info(scipy.optimize) -Travis From chanley at stsci.edu Tue Aug 9 13:28:26 2005 From: chanley at stsci.edu (Christopher Hanley) Date: Tue, 09 Aug 2005 13:28:26 -0400 Subject: [SciPy-user] scipy.isnan() on Mac OSX Message-ID: <42F8E7BA.4060004@stsci.edu> Greetings, I have recently been working on developing a fast isnan() function for numarray. My first attempt was to port the scipy.isnan() function to numarray as a basis for a solution. However, I found that this code did not return appropriate results on the Mac OSX platform. Since, I do not have access to a Mac OSX platform running scipy I was hoping that one of the Mac users out there could perform a simple test for me. If some nice Mac user could issue the following command, -> scipy.isnan(scipy.nan) and let me know the result, I would really appreciate it. Thank you for your time and effort, Chris -- Christopher Hanley Senior Software Engineer Space Telescope Science Institute 3700 San Martin Drive Baltimore MD, 21218 (410) 338-4338 From rkern at ucsd.edu Tue Aug 9 15:27:25 2005 From: rkern at ucsd.edu (Robert Kern) Date: Tue, 09 Aug 2005 12:27:25 -0700 Subject: [SciPy-user] scipy.isnan() on Mac OSX In-Reply-To: <42F8E7BA.4060004@stsci.edu> References: <42F8E7BA.4060004@stsci.edu> Message-ID: <42F9039D.5090607@ucsd.edu> Christopher Hanley wrote: > Greetings, > > I have recently been working on developing a fast isnan() function for > numarray. My first attempt was to port the scipy.isnan() function to > numarray as a basis for a solution. However, I found that this code did > not return appropriate results on the Mac OSX platform. > > Since, I do not have access to a Mac OSX platform running scipy I was > hoping that one of the Mac users out there could perform a simple test > for me. If some nice Mac user could issue the following command, > > -> scipy.isnan(scipy.nan) > > and let me know the result, I would really appreciate it. In [103]: scipy.isnan(scipy.nan) Out[103]: 1 -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From oliphant at ee.byu.edu Tue Aug 9 17:18:11 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 09 Aug 2005 15:18:11 -0600 Subject: [SciPy-user] Python number handling? In-Reply-To: <42D79D40.6080003@ucsd.edu> References: <056D32E9B2D93B49B01256A88B3EB218766E5B@icex2.ic.ac.uk> <42D79D40.6080003@ucsd.edu> Message-ID: <42F91D93.20007@ee.byu.edu> Robert Kern wrote: > Howey, David A wrote: > >> I'm new to python... >> Why, why oh why did someone decide to make python do this: >> >> Integer case >> >> In [5]: 107 / 4 Out[5]: 26 >> >> Float case >> >> In [6]: 107.0 / 4 >> Out[6]: 26.75 >> >> I'm a bit worried that when it come to using variables, because you >> don't declare them (eg as integer or float) python might mess up >> division and give you the first result above rather than the second. >> >> Has anyone had any problems with this? > > > Long, long ago, Guido decided to make integers behave this way because > C integers behaved this way (close enough at any rate; Python differs > from C with negative integers, but arguably does something more > consistent). In many cases, this behavior is actually useful although > it tends to get in the way a good amount of the time. Robert is, as usual, spot on with his comments. It should be noted that Python is moving towards having 107 / 4 return the floating-point result while 107 // 4 will be integer division. Note the following on Python 2.3.4 >>> 107 / 4 26 >>> from __future__ import division >>> 107 / 4 26.75 I still think it is a good idea to use 4.0 when you mean to interpret 4 as a float. -Travis From jdc at uwo.ca Tue Aug 9 23:16:46 2005 From: jdc at uwo.ca (Dan Christensen) Date: Tue, 09 Aug 2005 23:16:46 -0400 Subject: [SciPy-user] Re: finding approximate rank of matrix In-Reply-To: <87wtn22tky.fsf@uwo.ca> References: <87wtn22tky.fsf@uwo.ca> Message-ID: <878xzalbvl.fsf@uwo.ca> Ok, my next question on this topic: Suppose you have 300 vectors each with 64 components. You have determined using the singular value decomposition of the 300x64 matrix they form that they all approximately lie in a 40-dimensional subspace. You suspect, however, that they really lie in the union of two 30-dimensional subspaces (which intersect in a 20-dimensional subspace). How could you show this? For example, suppose your vectors are in R^3 and all lie approximately along either the x-axis or the y-axis. The singular value decomposition shows you that they all lie approximately in the xy-plane. Then, in this low-dimensional case, you can just notice that every vector is a multiple of two chosen vectors. But with 30-dimensional subspaces it's not clear how to choose spanning vectors for the hypothetical subspaces... Thanks for any ideas, Dan PS: If it helps, I also can generate additional semi-random vectors that lie in the same subspaces. But I don't have a good way of testing whether a particular vector is in those subspaces. From nwagner at mecha.uni-stuttgart.de Wed Aug 10 03:42:23 2005 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 10 Aug 2005 09:42:23 +0200 Subject: [SciPy-user] New repository path (svn) for ipython ? Message-ID: <42F9AFDF.8090803@mecha.uni-stuttgart.de> How about the new repository path for ipython ? Nils From d.howey at imperial.ac.uk Wed Aug 10 05:46:42 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Wed, 10 Aug 2005 10:46:42 +0100 Subject: [SciPy-user] Installing Ipython Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E70D@icex2.ic.ac.uk> I'm getting a strange error when trying to install IPython on my wife's laptop (under Win98SE). Everything else (Python 2.3, IDLE, ctypes, readline, scipy, numpy, matplotlib etc) is installed on the laptop and works fine. But when I install Ipython, when it's running the post install script, I get the following error: Traceback (most recent call last): File "", line 74, in ? File "", line 22, in install OSError: no such folder (CSIDL_COMMON_PROGRAMS) *** run_installscript: internal error 0xFFFFFFF *** Does anyone know how to rectify this? Thanks very much and thanks also to those who have helped me with all my questions over the last few weeks. I now have a beautiful secant method root finding happily! Dave Howey -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhunter at ace.bsd.uchicago.edu Wed Aug 10 07:42:56 2005 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Wed, 10 Aug 2005 06:42:56 -0500 Subject: [SciPy-user] New repository path (svn) for ipython ? In-Reply-To: <42F9AFDF.8090803@mecha.uni-stuttgart.de> (Nils Wagner's message of "Wed, 10 Aug 2005 09:42:23 +0200") References: <42F9AFDF.8090803@mecha.uni-stuttgart.de> Message-ID: <871x52vwzj.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Nils" == Nils Wagner writes: Nils> How about the new repository path for ipython ? Nils I believe the magic incantation is svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython JDH From haley at ucar.edu Wed Aug 10 13:19:35 2005 From: haley at ucar.edu (Mary Haley) Date: Wed, 10 Aug 2005 11:19:35 -0600 (MDT) Subject: [SciPy-user] Python number handling? In-Reply-To: <20050810021845.C76643EB5B@www.scipy.com> References: <20050810021845.C76643EB5B@www.scipy.com> Message-ID: > Robert Kern wrote: > >> Howey, David A wrote: >> >>> I'm new to python... >>> Why, why oh why did someone decide to make python do this: >>> >>> Integer case >>> >>> In [5]: 107 / 4 Out[5]: 26 >>> >>> Float case >>> >>> In [6]: 107.0 / 4 >>> Out[6]: 26.75 >>> >>> I'm a bit worried that when it come to using variables, because you >>> don't declare them (eg as integer or float) python might mess up >>> division and give you the first result above rather than the second. >>> >>> Has anyone had any problems with this? >> >> >> Long, long ago, Guido decided to make integers behave this way because >> C integers behaved this way (close enough at any rate; Python differs >> from C with negative integers, but arguably does something more >> consistent). In many cases, this behavior is actually useful although >> it tends to get in the way a good amount of the time. > > Robert is, as usual, spot on with his comments. > > It should be noted that Python is moving towards having 107 / 4 return > the floating-point result while 107 // 4 will be integer division. > > Note the following on Python 2.3.4 > > >>> 107 / 4 > 26 > >>> from __future__ import division > >>> 107 / 4 > 26.75 > > > I still think it is a good idea to use 4.0 when you mean to interpret 4 > as a float. > > -Travis This seems like a major fundamental change to make to a language, especially this late in the game. Won't this kind of thing break lots of existing codes? Don't people depend on this for integer indexing? It seems that the old behavior should be kept as is, and some completely new syntax should be used for forcing floating point behavior. (Or, as Travis pointed out, just use a floating point when you really want floating point calculations to take place.) I am rather shocked by this revelation, and am anxious to hear how others in SciPy-land feel about this change. --Mary ------------------------------------------------- Mary Haley haley at ucar.edu NCAR/SCD/VETS 303-497-1254 (voice) 1850 Table Mesa Dr 303-497-1239 (fax) Boulder, CO 80305 ------------------------------------------------- From aisaac at american.edu Wed Aug 10 13:30:01 2005 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 10 Aug 2005 13:30:01 -0400 Subject: [SciPy-user] Python number handling? In-Reply-To: References: <20050810021845.C76643EB5B@www.scipy.com> Message-ID: On Wed, 10 Aug 2005, Mary Haley apparently wrote: > It seems that the old behavior should be kept as is, and some > completely new syntax should be used for forcing floating point > behavior. I think the idea is to reduce surprises, and I agree the change does that. You might see http://www.python.org/doc/2.2.3/whatsnew/node7.html http://www.python.org/peps/pep-0238.html This is not really news. Cheers, Alan Isaac From oliphant at ee.byu.edu Wed Aug 10 13:52:54 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Wed, 10 Aug 2005 11:52:54 -0600 Subject: [SciPy-user] Python number handling? In-Reply-To: References: <20050810021845.C76643EB5B@www.scipy.com> Message-ID: <42FA3EF6.7050601@ee.byu.edu> Mary Haley wrote: >> >> Robert is, as usual, spot on with his comments. >> >> It should be noted that Python is moving towards having 107 / 4 return >> the floating-point result while 107 // 4 will be integer division. >> >> Note the following on Python 2.3.4 >> >> >>> 107 / 4 >> 26 >> >>> from __future__ import division >> >>> 107 / 4 >> 26.75 >> >> >> I still think it is a good idea to use 4.0 when you mean to interpret 4 >> as a float. >> >> -Travis > > > This seems like a major fundamental change to make to a language, > especially this late in the game. Won't this kind of thing break lots > of existing codes? Don't people depend on this for integer indexing? As Alan mentioned, the change has been "taking place" for several years now, so that the amount of code it will break is going to be small. The actual change won't happen until Python 3000 (along with other promised changes). So, I don't see it as a big deal. If you want integer division, then for long term compatibility, use '//' explicitly. Yes, there are probably places that will need fixing to port to Python 3000, because this rule was not followed for code written prior to Python 2.2. The same could be said for other packages as well. So, the transition to Python 3000 (which may not come for another 3-5 years), will require a little bit of effort -- but not a lot, since there aren't many examples of this kind of usage. IMHO Python developers have done a good job of adapting (and improving) the language without breaking old code which is another reason I enjoy using Python. -Travis O. From haley at ucar.edu Wed Aug 10 14:07:20 2005 From: haley at ucar.edu (Mary Haley) Date: Wed, 10 Aug 2005 12:07:20 -0600 (MDT) Subject: [SciPy-user] Python number handling? In-Reply-To: <42FA3EF6.7050601@ee.byu.edu> References: <20050810021845.C76643EB5B@www.scipy.com> <42FA3EF6.7050601@ee.byu.edu> Message-ID: On Wed, 10 Aug 2005, Travis Oliphant wrote: > Mary Haley wrote: > >>> >>> Robert is, as usual, spot on with his comments. >>> >>> It should be noted that Python is moving towards having 107 / 4 return >>> the floating-point result while 107 // 4 will be integer division. >>> >>> Note the following on Python 2.3.4 >>> >>> >>> 107 / 4 >>> 26 >>> >>> from __future__ import division >>> >>> 107 / 4 >>> 26.75 >>> >>> >>> I still think it is a good idea to use 4.0 when you mean to interpret 4 >>> as a float. >>> >>> -Travis >> >> >> This seems like a major fundamental change to make to a language, >> especially this late in the game. Won't this kind of thing break lots >> of existing codes? Don't people depend on this for integer indexing? > > > As Alan mentioned, the change has been "taking place" for several years now, > so that the amount of code it will break is > going to be small. The actual change won't happen until Python 3000 (along > with other promised changes). > > So, I don't see it as a big deal. If you want integer division, then for > long term compatibility, use '//' explicitly. Yes, there are probably places > that will need fixing to port to Python 3000, because this rule was not > followed for code written prior to Python 2.2. The same could be said for > other packages as well. So, the transition to Python 3000 (which may not > come for another 3-5 years), will require a little bit of effort -- but not a > lot, since there aren't many examples of this kind of usage. > > IMHO Python developers have done a good job of adapting (and improving) the > language without breaking old code which is another reason I enjoy using > Python. > > -Travis O. Thanks for the information Travis. I should have realized something like this wouldn't happen willy nilly in the Python world. The Python folks do seem to have a lot of things in place to help with the transition, including optional warning messages, and another operator to help get the old style. Since I'm a stickler for backwards compatibility, especially for a language that has been around as long as Python, the reasoning for this kind of change is not going to sway me much. I should point out that this is not going break any of my own codes that I can think of, so it's not a personal issue. I'll be ready when it happens! :-) --Mary From rkern at ucsd.edu Wed Aug 10 18:41:06 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 10 Aug 2005 15:41:06 -0700 Subject: [SciPy-user] Re: finding approximate rank of matrix In-Reply-To: <878xzalbvl.fsf@uwo.ca> References: <87wtn22tky.fsf@uwo.ca> <878xzalbvl.fsf@uwo.ca> Message-ID: <42FA8282.1080605@ucsd.edu> Dan Christensen wrote: > Ok, my next question on this topic: > > Suppose you have 300 vectors each with 64 components. You have > determined using the singular value decomposition of the 300x64 matrix > they form that they all approximately lie in a 40-dimensional > subspace. You suspect, however, that they really lie in the union of > two 30-dimensional subspaces (which intersect in a 20-dimensional > subspace). How could you show this? Proof by construction: Take the first 30 orthogonal unit vectors from the 40D subspace. Take the last 30 unit vectors. The join of those two subspaces is the 40D subspace spanned by your 300 vectors. The meet is the 20D subspace spanned by the 20 shared orthogonal vectors. If you have specified the two 30D spaces and just want to test if your 300 vectors do indeed all fall into the join of the two subspaces, then stack both 30D subspaces, use the routine I gave you to get the spanned space as a set of 40 orthogonal vectors, project each of your 300 vectors onto this space and compare those vectors to the orginals. P|v> = |e_i> =?= |v> -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From lanceboyle at cwazy.co.uk Wed Aug 10 19:26:29 2005 From: lanceboyle at cwazy.co.uk (Lance Boyle) Date: Wed, 10 Aug 2005 16:26:29 -0700 Subject: [SciPy-user] Python number handling? In-Reply-To: References: <20050810021845.C76643EB5B@www.scipy.com> Message-ID: <197FA194-99F6-44FB-B726-D82B3C245AE6@cwazy.co.uk> On Aug 10, 2005, at 10:19 AM, Mary Haley wrote: > Robert Kern wrote: > > >> Howey, David A wrote: >> >> >>> I'm new to python... >>> Why, why oh why did someone decide to make python do this: >>> >>> Integer case >>> >>> In [5]: 107 / 4 Out[5]: 26 >>> >>> Float case >>> >>> In [6]: 107.0 / 4 >>> Out[6]: 26.75 >>> >>> I'm a bit worried that when it come to using variables, because you >>> don't declare them (eg as integer or float) python might mess up >>> division and give you the first result above rather than the second. >>> >>> Has anyone had any problems with this? >>> >> >> >> Long, long ago, Guido decided to make integers behave this way >> because >> C integers behaved this way (close enough at any rate; Python differs >> from C with negative integers, but arguably does something more >> consistent). In many cases, this behavior is actually useful although >> it tends to get in the way a good amount of the time. >> > > Robert is, as usual, spot on with his comments. > > It should be noted that Python is moving towards having 107 / 4 return > the floating-point result while 107 // 4 will be integer division. > > Note the following on Python 2.3.4 > > >>> 107 / 4 > 26 > >>> from __future__ import division > >>> 107 / 4 > 26.75 > > > I still think it is a good idea to use 4.0 when you mean to > interpret 4 > as a float. > > -Travis Yes. But what about a / b given that a and b are dynamically typed? Jerry From rkern at ucsd.edu Wed Aug 10 19:30:36 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 10 Aug 2005 16:30:36 -0700 Subject: [SciPy-user] Python number handling? In-Reply-To: <197FA194-99F6-44FB-B726-D82B3C245AE6@cwazy.co.uk> References: <20050810021845.C76643EB5B@www.scipy.com> <197FA194-99F6-44FB-B726-D82B3C245AE6@cwazy.co.uk> Message-ID: <42FA8E1C.3080702@ucsd.edu> Lance Boyle wrote: > Yes. But what about a / b given that a and b are dynamically typed? It's handled by their types' coercion rules and __truediv__ definitions (or __div__ if __truediv__ isn't defined). -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From rkern at ucsd.edu Wed Aug 10 19:57:46 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 10 Aug 2005 16:57:46 -0700 Subject: [SciPy-user] Python number handling? In-Reply-To: <42FA8E1C.3080702@ucsd.edu> References: <20050810021845.C76643EB5B@www.scipy.com> <197FA194-99F6-44FB-B726-D82B3C245AE6@cwazy.co.uk> <42FA8E1C.3080702@ucsd.edu> Message-ID: <42FA947A.8070904@ucsd.edu> Robert Kern wrote: > Lance Boyle wrote: > >> Yes. But what about a / b given that a and b are dynamically typed? > > It's handled by their types' coercion rules and __truediv__ definitions > (or __div__ if __truediv__ isn't defined). Sorry, that parenthetical is incorrect. From http://docs.python.org/ref/numeric-types.html : """ __div__(self, other) __truediv__(self, other) The division operator (/) is implemented by these methods. The __truediv__() method is used when __future__.division is in effect, otherwise __div__() is used. If only one of these two methods is defined, the object will not support division in the alternate context; TypeError will be raised instead.""" -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From jdc at uwo.ca Wed Aug 10 21:41:50 2005 From: jdc at uwo.ca (Dan Christensen) Date: Wed, 10 Aug 2005 21:41:50 -0400 Subject: [SciPy-user] Re: finding approximate rank of matrix In-Reply-To: <42FA8282.1080605@ucsd.edu> References: <87wtn22tky.fsf@uwo.ca> <878xzalbvl.fsf@uwo.ca> <42FA8282.1080605@ucsd.edu> Message-ID: <87r7d1ckrl.fsf@uwo.ca> Robert Kern writes: > Dan Christensen wrote: > >> Suppose you have 300 vectors each with 64 components. You have >> determined using the singular value decomposition of the 300x64 matrix >> they form that they all approximately lie in a 40-dimensional >> subspace. You suspect, however, that they really lie in the union of >> two 30-dimensional subspaces (which intersect in a 20-dimensional >> subspace). How could you show this? > > Proof by construction: Take the first 30 orthogonal unit vectors from > the 40D subspace. Take the last 30 unit vectors. The join of those two > subspaces is the 40D subspace spanned by your 300 vectors. The meet is > the 20D subspace spanned by the 20 shared orthogonal vectors. When you say "join", do you mean the sum of the subspaces, i.e. the subspace spanned by all vectors in the two subspaces? If so, that's not what I meant, and of course is trivial. I really mean the set-theoretic union of the subspaces. If you meant union too, then I don't see how to use your construction. > If you have specified the two 30D spaces and just want to test if your > 300 vectors do indeed all fall into the join of the two subspaces, Nope, that's the catch, I don't know the subspaces. If I did, I would just check that each vector is close to at least one of the subspaces, by projecting it in and comparing. Thanks, Dan From d.howey at imperial.ac.uk Thu Aug 11 10:06:50 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Thu, 11 Aug 2005 15:06:50 +0100 Subject: [SciPy-user] Ipython weirdness! Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E713@icex2.ic.ac.uk> I'd be most grateful if anyone could help with this problem. Thanks Dave ________________________________ From: scipy-user-bounces at scipy.net on behalf of Howey, David A Sent: Wed 10/08/2005 10:46 To: SciPy Users List Subject: [SciPy-user] Installing Ipython I'm getting a strange error when trying to install IPython on my wife's laptop (under Win98SE). Everything else (Python 2.3, IDLE, ctypes, readline, scipy, numpy, matplotlib etc) is installed on the laptop and works fine. But when I install Ipython, when it's running the post install script, I get the following error: Traceback (most recent call last): File "", line 74, in ? File "", line 22, in install OSError: no such folder (CSIDL_COMMON_PROGRAMS) *** run_installscript: internal error 0xFFFFFFF *** Does anyone know how to rectify this? Thanks very much and thanks also to those who have helped me with all my questions over the last few weeks. I now have a beautiful secant method root finding happily! Dave Howey -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4315 bytes Desc: not available URL: From rkern at ucsd.edu Thu Aug 11 10:20:10 2005 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 11 Aug 2005 07:20:10 -0700 Subject: [SciPy-user] Ipython weirdness! In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E713@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E713@icex2.ic.ac.uk> Message-ID: <42FB5E9A.6040907@ucsd.edu> Howey, David A wrote: > I'd be most grateful if anyone could help with this problem. Ask on the ipython list, then. http://scipy.net/mailman/listinfo/ipython-user -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From gpajer at rider.edu Thu Aug 11 10:34:23 2005 From: gpajer at rider.edu (Gary Pajer) Date: Thu, 11 Aug 2005 10:34:23 -0400 Subject: [SciPy-user] Ipython weirdness! In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E713@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E713@icex2.ic.ac.uk> Message-ID: <42FB61EF.1090409@rider.edu> Howey, David A wrote: >I'd be most grateful if anyone could help with this problem. >Thanks >Dave > >________________________________ > >From: scipy-user-bounces at scipy.net on behalf of Howey, David A >Sent: Wed 10/08/2005 10:46 >To: SciPy Users List >Subject: [SciPy-user] Installing Ipython > > >I'm getting a strange error when trying to install IPython on my wife's laptop (under Win98SE). Everything else (Python 2.3, IDLE, ctypes, readline, scipy, numpy, matplotlib etc) is installed on the laptop and works fine. But when I install Ipython, when it's running the post install script, I get the following error: > >Traceback (most recent call last): > File "", line 74, in ? > File "", line 22, in install >OSError: no such folder (CSIDL_COMMON_PROGRAMS) >*** run_installscript: internal error 0xFFFFFFF *** > Sorry I can't be specific. But you may save time by just uninstalling everything and reinstalling. It doesn't take that long on Windows. I googled CSIDL_COMMON_PROGRAMS and discovered: ** " CSIDL_COMMON_PROGRAMS** (0x0017) The file system directory that contains the directories for the common program groups that appear on the *Start* menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs. Valid only for Windows NT systems. " I don't know exactly if that helps. You could check and see if C:\Documents and Settings\All Users\Start Menu\Programs exists on your system. (Did that folder exist in Win98?? I can't recall ... Win98 was not based on NT ... HTH a little bit. -g From europa100 at comcast.net Thu Aug 11 11:12:57 2005 From: europa100 at comcast.net (Rob) Date: Thu, 11 Aug 2005 08:12:57 -0700 Subject: [SciPy-user] Numeric Python EM Projeect site Message-ID: <42FB6AF9.3020300@comcast.net> Hi all, After a few years of "being and nothingness" I have decide to put the Numeric Python EM Project site back up. I realized today after searching Google that I broke a lot of links. I want to host it somewhere, but putting it back on Verio somehow seems "over the top". (they wouldn't fix my hit counter, it should have been around 50k by the time I took the site down, not bad for a "geek" type site) More importantly, I want to use the latest software, whether that is Numarray or something else. So I suppose I have some hacking to do. My site is backed up here on numerous cd's and dvd's so nothing is lost. I want to get a new laptop today, as I have no skill whatsoever in html, and I have a fresh copy of Frontpage 2003 (how can you hate a man with 40 billion dollars? haha) Right now I use OpenBSD as the only OS on this Dell laptop. I have a renewed interest in astrophysics, and I know those guys use Python alot, just like at LLNL. It might be an impressive addition to the resume of this old EECS graduate (Berkeley 1984). I looked at the physics GRE and drew a blank. Its all up there, just buried deep in the subconscious. Thanks for listening. Sincerely, Rob N3FT From Fernando.Perez at colorado.edu Thu Aug 11 12:07:28 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Thu, 11 Aug 2005 10:07:28 -0600 Subject: [SciPy-user] Installing Ipython In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E70D@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E70D@icex2.ic.ac.uk> Message-ID: <42FB77C0.5020004@colorado.edu> Howey, David A wrote: > I'm getting a strange error when trying to install IPython on my wife's laptop (under Win98SE). Everything else (Python 2.3, IDLE, ctypes, readline, scipy, numpy, matplotlib etc) is installed on the laptop and works fine. But when I install Ipython, when it's running the post install script, I get the following error: > > Traceback (most recent call last): > File "", line 74, in ? > File "", line 22, in install > OSError: no such folder (CSIDL_COMMON_PROGRAMS) > *** run_installscript: internal error 0xFFFFFFF *** > > > Does anyone know how to rectify this? Sorry for missing this one on the first pass. The problem is most likely due to the post-install script not being compatible with Win98. I don't have access to win32 machines, and win9x is getting rare these days, so things are hardly tested there. You can just install ipython manually yourself: it won't give you start menu icons and whatnot, but it will work. From the README_windows.txt file: Installation ------------ Double-click the supplied .exe installer file. If all goes well, that's all you need to do. You should now have an IPython entry in your Start Menu. In case the automatic installer does not work for some reason, you can download the ipython-XXX.tar.gz file, which contains the full IPython source distribution (the popular WinZip can read .tar.gz files). After uncompressing the archive, you can install it at a command terminal just like any other Python module, by using python setup.py install'. After this completes, you can run the supplied win32_manual_post_install.py script which will add the relevant shortcuts to your startup menu. ------------------------------ Chances are the win32_manual_post_install.py won't run even manually for you, but all it does is make some convenience Start menu shortcuts (ipython and manuals, mostly). You can either live without them, or make them by hand. They are not essential for ipython's functionality. I hope this helps, let me know if you have any further questions. Cheers, f From scipy at dvdkwk.com Thu Aug 11 12:35:43 2005 From: scipy at dvdkwk.com (David K) Date: Thu, 11 Aug 2005 12:35:43 -0400 Subject: [SciPy-user] scipy.stats.scoreatpercentile(...) In-Reply-To: <42F9AFDF.8090803@mecha.uni-stuttgart.de> References: <42F9AFDF.8090803@mecha.uni-stuttgart.de> Message-ID: <935582509.20050811123543@dvdkwk.com> Hi, I was trying the scipy.stats.scoreatpercentile function: >>> import scipy >>> a = scipy.arange(1,11) >>> a array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) >>> scipy.stats.scoreatpercentile( a, 50 ) # find the 50th percentile 5.9050000000000002 Shouldn't the result be 5.5? Or perhaps I've misunderstood something? Thanks, David From scipy at dvdkwk.com Thu Aug 11 12:44:02 2005 From: scipy at dvdkwk.com (David K) Date: Thu, 11 Aug 2005 12:44:02 -0400 Subject: [SciPy-user] Re: scipy.stats.scoreatpercentile(...) In-Reply-To: <935582509.20050811123543@dvdkwk.com> References: <42F9AFDF.8090803@mecha.uni-stuttgart.de> <935582509.20050811123543@dvdkwk.com> Message-ID: <779340089.20050811124402@dvdkwk.com> Sorry..forgot to mention that I'm using the following: Python version: 2.3.5 Numeric version: 23.7 scipy version: 0.3.2 Windows XP Hi, I was trying the scipy.stats.scoreatpercentile function: >>> import scipy >>> a = scipy.arange(1,11) >>> a array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) >>> scipy.stats.scoreatpercentile( a, 50 ) # find the 50th percentile 5.9050000000000002 Shouldn't the result be 5.5? Or perhaps I've misunderstood something? Thanks, David From syd.diamond at gmail.com Thu Aug 11 12:58:20 2005 From: syd.diamond at gmail.com (Syd Diamond) Date: Thu, 11 Aug 2005 12:58:20 -0400 Subject: [SciPy-user] Numeric array functionality for cloning matlab's zscore(matrix) Message-ID: Long time scipy fan, first time poster :) Anyways, I've always dealt with list objects in the past, but as strange as this might sound, I'm not up to par on manipulating array objects. I'm need eigenvector functionality for a project I'm working on, and so I started to work with the arrays more directly. The limitations of my expertise became clear when my clone of the simple zscore matlab function got me the right results but in a very ugly manner. For one, when I declared a matrix of zeros, when I defined elements as X[i,j] I could not change the type from int to float. In [10]: X = zeros((2,2)) In [11]: X[0,0] = 1.5 In [12]: X[0,0] Out[12]: 1 Well, that's just one thing. You'll see that my code below is ugly (although it gives me the right result). I researched online, looked at the source code for various scripts using Numeric, and tried to find an irc channel, but I never got what I needed. ** Can someone please help me better understand arrays and perhaps suggest a better way to implement this simple zscore function? Thank you. MATLAB HELP: >> help zscore ZSCORE Standardized z score. Z = ZSCORE(X) returns a centered, scaled version of X, known as the Z scores of X. For a vector input, Z = (X - MEAN(X)) ./ STD(X). For a matrix input, Z is a row vector containing the Z scores of each column of X. For N-D arrays, ZSCORE operates along the first non-singleton dimension. MY CODE (which matches the matlab results, but is _ugly_ from Numeric import array, shape, transpose, zeros from scipy import cov, mean, std A = array([[1, 2.3, 3],[1.1, 2.2, 2.9],[0.9, 1.9, 3.3]]) def zscore(X): #Z = zeros(shape(X)) # can't get rid of the ints Z = X.__deepcopy__(X) X = transpose(X) for i in xrange(shape(X)[0]): for j in xrange(shape(X)[1]): Z[j,i] = float((X[i,j] - mean(X[i])) / std(X[i])) return Z print zscore(A) From aisaac at american.edu Thu Aug 11 14:34:32 2005 From: aisaac at american.edu (Alan G Isaac) Date: Thu, 11 Aug 2005 14:34:32 -0400 Subject: =?ISO-8859-1?Q?Re:=20[SciPy-user]=20Numeric=20array=20functionality=20for?==?ISO-8859-1?Q?=20cloning=20matlab's=09zscore(matrix)?= In-Reply-To: References: Message-ID: On Thu, 11 Aug 2005, Syd Diamond apparently wrote: > Can someone ... perhaps suggest a better way to implement > this simple zscore function? import scipy as S nx = (x-S.mean(x,axis=0))/S.std(x,axis=0) hth, Alan Isaac From cookedm at physics.mcmaster.ca Thu Aug 11 14:50:57 2005 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Thu, 11 Aug 2005 14:50:57 -0400 Subject: [SciPy-user] Numeric array functionality for cloning matlab's zscore(matrix) In-Reply-To: (Syd Diamond's message of "Thu, 11 Aug 2005 12:58:20 -0400") References: Message-ID: Syd Diamond writes: > Long time scipy fan, first time poster :) > > Anyways, I've always dealt with list objects in the past, but as > strange as this might sound, I'm not up to par on manipulating array > objects. I'm need eigenvector functionality for a project I'm working > on, and so I started to work with the arrays more directly. > > The limitations of my expertise became clear when my clone of the > simple zscore matlab function got me the right results but in a very > ugly manner. For one, when I declared a matrix of zeros, when I > defined elements as X[i,j] I could not change the type from int to > float. > > In [10]: X = zeros((2,2)) > In [11]: X[0,0] = 1.5 > In [12]: X[0,0] > Out[12]: 1 zeros, like most (all?) of the array constructors takes a 'typecode' argument (or 'type' in numarray). You'll want In [1]: import Numeric In [2]: X = Numeric.zeros((2,2), typecode=Numeric.Float) In [3]: X[0,0] = 1.5 In [4]: X[0,0] Out[4]: 1.5 In your code below you construct Z, so you'd probably want to match X's typecode: Z = Numeric.zeros((2,2), typecode=X.typecode()) > Well, that's just one thing. You'll see that my code below is ugly > (although it gives me the right result). I researched online, looked > at the source code for various scripts using Numeric, and tried to > find an irc channel, but I never got what I needed. > > ** Can someone please help me better understand arrays and perhaps > suggest a better way to implement this simple zscore function? Thank > you. The Numeric documentation is at http://numeric.scipy.org/ . You may also want to look at the numarray documentation also: it should for the most part be similiar to Numeric, and may explain some points better. > MATLAB HELP: >>> help zscore > ZSCORE Standardized z score. > Z = ZSCORE(X) returns a centered, scaled version of X, known as the Z > scores of X. For a vector input, Z = (X - MEAN(X)) ./ STD(X). For a > matrix input, Z is a row vector containing the Z scores of each column > of X. For N-D arrays, ZSCORE operates along the first non-singleton > dimension. > > MY CODE (which matches the matlab results, but is _ugly_ > > from Numeric import array, shape, transpose, zeros > from scipy import cov, mean, std > A = array([[1, 2.3, 3],[1.1, 2.2, 2.9],[0.9, 1.9, 3.3]]) > def zscore(X): > #Z = zeros(shape(X)) # can't get rid of the ints > Z = X.__deepcopy__(X) > X = transpose(X) > for i in xrange(shape(X)[0]): > for j in xrange(shape(X)[1]): > Z[j,i] = float((X[i,j] - mean(X[i])) / std(X[i])) > return Z > > print zscore(A) from Numeric import array from scipy import mean, std A = array([[1, 2.3, 3],[1.1, 2.2, 2.9],[0.9, 1.9, 3.3]]) def zscore(X): Z = (X - mean(X)) / std(X) return Z print zscore(A) [[ 0. , 0.80064077,-0.32025631,] [ 1. , 0.32025631,-0.80064077,] [-1. ,-1.12089708, 1.12089708,]] You'll have to understand array broadcasting to see how that works. If X has a shape (5,10), then mean(X) has a shape (10,). When the two are subtracted, mean(X) is expanded (not really, but it acts that way) to a shape (5,10), where the rows are replicated 5 times. The two then can be subracted elementwise. Same for dividing by std(X). -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From tedang at yahoo.com Thu Aug 11 16:53:36 2005 From: tedang at yahoo.com (Ted Dang) Date: Thu, 11 Aug 2005 13:53:36 -0700 (PDT) Subject: [SciPy-user] Numeric array indexing using an array? Message-ID: <20050811205336.97349.qmail@web50902.mail.yahoo.com> Is there an easy way of indexing an array using another array? (I know this can be done using a for loop) Given: >>> x=arange(10) >>> y=rand(10) Want: >>> z=y(x) >>> z array([ 0.90511394, 0.03744266, 0.31686115, 0.81548136, 0.08736623, 0.58499157, 0.25363156, 0.84046161, 0.8481133 , 0.85724437]) ============================================ Also, is this how I'm supposed to use this mailing list? For newbie questions? ============================================ How do I suppress output/print from command line? Want: >>> x; >>> Not: >>> x array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From ckkart at hoc.net Fri Aug 12 04:29:23 2005 From: ckkart at hoc.net (Christian Kristukat) Date: Fri, 12 Aug 2005 10:29:23 +0200 Subject: [SciPy-user] Numeric array indexing using an array? In-Reply-To: <20050811205336.97349.qmail@web50902.mail.yahoo.com> References: <20050811205336.97349.qmail@web50902.mail.yahoo.com> Message-ID: <42FC5DE3.2060603@hoc.net> Ted Dang wrote: > Is there an easy way of indexing an array using > another array? (I know this can be done using a for > loop) > > Given: > >>>>x=arange(10) >>>>y=rand(10) > > > Want: > >>>>z=y(x) >>>>z z = take(y, x) > > Also, is this how I'm supposed to use this mailing > list? For newbie questions? how about reading the Numeric manual? It's not that long. > How do I suppress output/print from command line? > > Want: > >>>>x; >>>> So what is that line for? e.g. a=x will not print anything (and not do much though) Regards, Christian From europa100 at comcast.net Fri Aug 12 16:13:58 2005 From: europa100 at comcast.net (Rob) Date: Fri, 12 Aug 2005 13:13:58 -0700 Subject: [SciPy-user] still looking for host for Numeric Python EM site Message-ID: <42FD0306.6030205@comcast.net> Hi all, I'm still looking for a for a benevolent soul to host the Numeric Python EM site. I bought a new laptop just for Windoze, so I can keep OpenBSD and Windoze seperate (they hate each other! haha), and so I can use my nice Frontpage 2003 (I am an html knownothing). I want to immediately announce that the site is no longer dead and repair all the damaged links. First thing I put on the computer were python 2.3.x, SciPy, and EZNEC (the nice NEC2 graphical program) so I will have fun with it there as well. I am looking forward to seeing what new neat stuff you guys have come up with. I am particularly looking to either fix or get rid of that Animabob 3d OpenGL viewer app as its speed is tied to graphics card speed. It runs so fast now that only Cygwin can slow it down to human realm (kind of like that Star Trek episode where Kirk starts going so fast that no one can see him). OpenBSD is somewhat problematic here as I can't seem to get much of any Linux targeted programs to configure then compile. I don't know whats up with that, but OpenBSD has good Linux binary emulation ie. wrapping. Sincerely, Rob N3FT/7 (Hillsboro, Silcon Forest) From skip at pobox.com Fri Aug 12 17:14:14 2005 From: skip at pobox.com (skip at pobox.com) Date: Fri, 12 Aug 2005 16:14:14 -0500 Subject: [SciPy-user] Nasty side effect of importing rpy in scipy.stats Message-ID: <17149.4390.738872.833143@montanaro.dyndns.org> Just a heads up here folks... We couldn't figure out why we had trouble Ctl-C-ing out of our applications. Further, when we did we often got core dumps. If gdb could tell us anything (the stack was often correupt), it often told us it was in the bowels of libR. We don't use Rpy in our app, but we do use scipy. A side-effect of the scipy import is for scipy.stats to try to import Rpy. That import has the side effect of creating and starting a new thread that starts up an R event loop. R provides its own wrapper around select (R_SelectEx) that installs its own SIGINT handler. Needless to say, this is bad on a couple different levels. My workaround was to comment out the attempted import of Rpy in scipy.stats (since we don't use R via that route). Caveat emptor... -- Skip Montanaro skip at pobox.com From europa100 at comcast.net Fri Aug 12 17:25:31 2005 From: europa100 at comcast.net (Rob) Date: Fri, 12 Aug 2005 14:25:31 -0700 Subject: [SciPy-user] still looking for host for Numeric Python EM site In-Reply-To: <42FD0306.6030205@comcast.net> References: <42FD0306.6030205@comcast.net> Message-ID: <42FD13CB.9020609@comcast.net> Rob wrote: > Hi all, > > I'm still looking for a for a benevolent soul to host the Numeric Python > EM site. I bought a new laptop just for Windoze, so I can keep OpenBSD > and Windoze seperate (they hate each other! haha), and so I can use my > nice Frontpage 2003 (I am an html knownothing). I want to immediately > announce that the site is no longer dead and repair all the damaged links. > > First thing I put on the computer were python 2.3.x, SciPy, and EZNEC > (the nice NEC2 graphical program) so I will have fun with it there as > well. I am looking forward to seeing what new neat stuff you guys have > come up with. I am particularly looking to either fix or get rid of > that Animabob 3d OpenGL viewer app as its speed is tied to graphics card > speed. It runs so fast now that only Cygwin can slow it down to human > realm (kind of like that Star Trek episode where Kirk starts going so > fast that no one can see him). > > OpenBSD is somewhat problematic here as I can't seem to get much of any > Linux targeted programs to configure then compile. I don't know whats > up with that, but OpenBSD has good Linux binary emulation ie. wrapping. > > Sincerely, Rob N3FT/7 (Hillsboro, Silcon Forest) > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > Forget about this for now. I forgot I had hosting capabilities with my evil Comcast account. However, it would be nice to put it under a cooler domain. Rob. From aisaac at american.edu Fri Aug 12 16:35:51 2005 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 12 Aug 2005 16:35:51 -0400 Subject: [SciPy-user] still looking for host for Numeric Python EM site In-Reply-To: <42FD0306.6030205@comcast.net> References: <42FD0306.6030205@comcast.net> Message-ID: On Fri, 12 Aug 2005, Rob apparently wrote: > I'm still looking for a for a benevolent soul to host the > Numeric Python EM site. Until then you could add some links from the SciPy Wiki http://www.scipy.org/wikis/topical_software/TopicalSoftware to your Comcast site. fwiw, Alan Isaac From europa100 at comcast.net Fri Aug 12 18:14:40 2005 From: europa100 at comcast.net (Rob) Date: Fri, 12 Aug 2005 15:14:40 -0700 Subject: [SciPy-user] still looking for host for Numeric Python EM site In-Reply-To: References: <42FD0306.6030205@comcast.net> Message-ID: <42FD1F50.1010908@comcast.net> Alan G Isaac wrote: > On Fri, 12 Aug 2005, Rob apparently wrote: > >>I'm still looking for a for a benevolent soul to host the >>Numeric Python EM site. > > > Until then you could add some links from the SciPy Wiki > http://www.scipy.org/wikis/topical_software/TopicalSoftware > to your Comcast site. > > fwiw, > Alan Isaac > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > 6 Hi Alan, Thanks for the info. For now I am getting this XP-Pro machine melded to my wishes with plenty of restore points along the way, haha. Its getting faster and faster to reboot by the minute. Thank god for Group Policy, Service control, and the registry "Run" and "Run Once" entries. I also have the squashed MS program called "bootvis". It rearranges the loading of all of your drivers so that they go in a predefined order instead of being dumped all at once into the scheduler and hanging everything up. When I had Windoze on my Dell laptop, the Dell repair man said that I had the fastest booting XP machine he had ever seen. Rob From travis at enthought.com Fri Aug 12 19:12:22 2005 From: travis at enthought.com (Travis N. Vaught) Date: Fri, 12 Aug 2005 18:12:22 -0500 Subject: [SciPy-user] SciPy 2005 Conference: Preliminary Schedule of Presentations Message-ID: <42FD2CD6.9020904@enthought.com> All, I've posted a preliminary schedule of presentations at: http://www.scipy.org/wikis/scipy05/ConferenceSchedule Please feel free to provide comments or corrections--either to the list or directly to me. If you haven't registered, you may do so at: https://www.enthought.com/scipy05/ More information about the conference is at: http://www.scipy.org/wikis/scipy05/ Regards, Travis (Vaught) From Fernando.Perez at colorado.edu Fri Aug 12 19:35:19 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Fri, 12 Aug 2005 17:35:19 -0600 Subject: [SciPy-user] SciPy 2005 Conference: Preliminary Schedule of Presentations In-Reply-To: <42FD2CD6.9020904@enthought.com> References: <42FD2CD6.9020904@enthought.com> Message-ID: <42FD3237.2090707@colorado.edu> Hey Travis, Travis N. Vaught wrote: > I've posted a preliminary schedule of presentations at: > > http://www.scipy.org/wikis/scipy05/ConferenceSchedule > > Please feel free to provide comments or corrections--either to the list > or directly to me. Dead abstracts links... Cheers, f From europa100 at comcast.net Mon Aug 15 14:25:59 2005 From: europa100 at comcast.net (rob) Date: Mon, 15 Aug 2005 11:25:59 -0700 Subject: [SciPy-user] Numeric Python EM site back up Message-ID: <4300DE37.9060100@comcast.net> Its at http://home.comcast.net/~europa100 I would later like to bring it up to 2005 standards with the latest numeric and/or numarray and/or scipy stuff later. I would also like a more "glamorous" location for it, haha. Rob. From ryanfedora at comcast.net Mon Aug 15 16:12:20 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Mon, 15 Aug 2005 16:12:20 -0400 Subject: [SciPy-user] SciPy Installer for Python 2.4 on Windows Message-ID: <4300F724.4030702@comcast.net> Is there any news on when there will be a SciPy Windows installer for Python 2.4? Has anyone running windows installed SciPy for Python 2.4 from source? Can it be done without the Microsoft compiler? What would I need to do about Atlas? Thanks, Ryan From europa100 at comcast.net Mon Aug 15 17:28:37 2005 From: europa100 at comcast.net (Rob) Date: Mon, 15 Aug 2005 14:28:37 -0700 Subject: [SciPy-user] my website on scipy wiki? Message-ID: <43010905.9000805@comcast.net> I am not going to do anything before I get permission or actually know what I am doing, but I at least know I can log onto the wiki. Since the Numeric Python EM Project is now up and running, what should I do on the wike, if anything, to anounce that it exists? Thanks, Rob From aisaac at american.edu Mon Aug 15 17:35:48 2005 From: aisaac at american.edu (Alan G Isaac) Date: Mon, 15 Aug 2005 17:35:48 -0400 Subject: [SciPy-user] my website on scipy wiki? In-Reply-To: <43010905.9000805@comcast.net> References: <43010905.9000805@comcast.net> Message-ID: On Mon, 15 Aug 2005, Rob apparently wrote: > I am not going to do anything before I get permission I'd put it here: http://www.scipy.org/wikis/topical_software/TopicalSoftware#Topics As I understand Wikis, not permission is required. Cheers, Alan Isaac From Fernando.Perez at colorado.edu Mon Aug 15 17:36:03 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Mon, 15 Aug 2005 15:36:03 -0600 Subject: [SciPy-user] my website on scipy wiki? In-Reply-To: <43010905.9000805@comcast.net> References: <43010905.9000805@comcast.net> Message-ID: <43010AC3.5040506@colorado.edu> Rob wrote: > I am not going to do anything before I get permission or actually know > what I am doing, but I at least know I can log onto the wiki. > > Since the Numeric Python EM Project is now up and running, what should I > do on the wike, if anything, to anounce that it exists? You can find an appropriate category for it and list it here, http://www.scipy.org/wikis/topical_software/TopicalSoftware with a _brief_ description and a link to the actual site. There are already links there to PyFemax and FiPy, so you may want to put it next to those to help maintain thematic coherence. Cheers, f From rkern at ucsd.edu Mon Aug 15 19:15:37 2005 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 15 Aug 2005 16:15:37 -0700 Subject: [SciPy-user] scipy.stats.scoreatpercentile(...) In-Reply-To: <935582509.20050811123543@dvdkwk.com> References: <42F9AFDF.8090803@mecha.uni-stuttgart.de> <935582509.20050811123543@dvdkwk.com> Message-ID: <43012219.5030206@ucsd.edu> David K wrote: > Hi, > > I was trying the scipy.stats.scoreatpercentile function: > > >>>>import scipy >>>>a = scipy.arange(1,11) >>>>a > > array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) > >>>>scipy.stats.scoreatpercentile( a, 50 ) # find the 50th percentile > > 5.9050000000000002 > > Shouldn't the result be 5.5? Or perhaps I've misunderstood something? I think scoreatpercentile() is kind of broken for this input. It uses histogram() under the covers; I think the defaults for histogram() (e.g. 10 bins) and its boundary heuristics are a bit pathological for this input. Well, they're not so bad by themselves, but scoreatpercentile() trusts them more than is wise in this case. In [3]: a = arange(1,11) In [4]: a Out[4]: array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) In [5]: stats.scoreatpercentile(a, 100.0) Out[5]: 10.265000000000001 In [6]: stats.scoreatpercentile(a, 10.0) Out[6]: -9.3550000000000004 In [7]: stats.scoreatpercentile(a, 11.0) Out[7]: 1.6540000000000001 In [8]: stats.histogram(a) Out[8]: (array([1, 1, 1, 1, 1, 1, 2, 1, 1, 0]), 0.45499999999999996, 1.0900000000000001, 0) Alternately, In [9]: a = stats.uniform.rvs(1.0, 9.0, size=1000) In [10]: stats.histogram(a) Out[10]: (array([ 49, 124, 123, 118, 117, 124, 115, 137, 93, 0]), 0.46266254770569504, 1.0880739132501185, 0) In [11]: stats.scoreatpercentile(a, 50.0) Out[11]: 5.6147390258301879 In [12]: stats.scoreatpercentile(a, 10.0) Out[12]: 1.9982507317280398 -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From novak at ucolick.org Mon Aug 15 19:31:08 2005 From: novak at ucolick.org (Greg Novak) Date: Mon, 15 Aug 2005 16:31:08 -0700 (PDT) Subject: [SciPy-user] CVS and SVN? Message-ID: I'm getting cvs [login aborted]: connect to scipy.org(216.62.213.228):2401 failed: Connection refused after: cvs -d :pserver:anonymous at scipy.org:/home/cvsroot login There seems to have been some talk on the mailing list about migrating to subversion, and the web-browsable CVS repository seems to confirm that this has happened. However, I can't find any info about how to access the new system, and (semi) educated guesses don't seem to work (like 'svn co svn://svn.scipy.org' for example). Thanks for any tips, Greg From nwagner at mecha.uni-stuttgart.de Tue Aug 16 02:32:17 2005 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 16 Aug 2005 08:32:17 +0200 Subject: [SciPy-user] CVS and SVN? In-Reply-To: References: Message-ID: <43018871.4010104@mecha.uni-stuttgart.de> Greg Novak wrote: > I'm getting > cvs [login aborted]: connect to scipy.org(216.62.213.228):2401 failed: > Connection refused > > after: > cvs -d :pserver:anonymous at scipy.org:/home/cvsroot login > > There seems to have been some talk on the mailing list about migrating > to subversion, and the web-browsable CVS repository seems to confirm > that this has happened. However, I can't find any info about how to > access the new system, and (semi) educated guesses don't seem to work > (like 'svn co svn://svn.scipy.org' for example). > > Thanks for any tips, > Greg > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user svn co http://svn.scipy.org/svn/scipy/trunk scipy svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython Nils From vincent.alcouffe at newlogic.fr Tue Aug 16 05:55:17 2005 From: vincent.alcouffe at newlogic.fr (Vincent Alcouffe) Date: Tue, 16 Aug 2005 11:55:17 +0200 Subject: [SciPy-user] Pyhton2.4 and SciPy Message-ID: <4301B805.4090009@newlogic.fr> Hi all, I've one question regarding Python version 2.4 and Scipy module version 0.3.2. Does the Python 2.4 works well with scipy 0.3.2? Or is it needed to have Python 2.3.x in order to work with scipy 0.3.2? Thanks. -Vincent From d.howey at imperial.ac.uk Tue Aug 16 07:08:40 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Tue, 16 Aug 2005 12:08:40 +0100 Subject: [SciPy-user] Pyhton2.4 and SciPy Message-ID: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> In my experience it only works with python 2.3 -----Original Message----- From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] On Behalf Of Vincent Alcouffe Sent: 16 August 2005 10:55 To: scipy-user at scipy.net Subject: [SciPy-user] Pyhton2.4 and SciPy Hi all, I've one question regarding Python version 2.4 and Scipy module version 0.3.2. Does the Python 2.4 works well with scipy 0.3.2? Or is it needed to have Python 2.3.x in order to work with scipy 0.3.2? Thanks. -Vincent _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user From nwagner at mecha.uni-stuttgart.de Tue Aug 16 07:11:46 2005 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 16 Aug 2005 13:11:46 +0200 Subject: [SciPy-user] Pyhton2.4 and SciPy In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> Message-ID: <4301C9F2.7060304@mecha.uni-stuttgart.de> Howey, David A wrote: >In my experience it only works with python 2.3 > I am using python2.4 and cvs scipy. It works fine. /home/nwagner> python 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 scipy >>> scipy.__version__ '0.3.3_309.4624' >>> Nils >-----Original Message----- >From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] >On Behalf Of Vincent Alcouffe >Sent: 16 August 2005 10:55 >To: scipy-user at scipy.net >Subject: [SciPy-user] Pyhton2.4 and SciPy > >Hi all, >I've one question regarding Python version 2.4 and Scipy module version >0.3.2. >Does the Python 2.4 works well with scipy 0.3.2? >Or is it needed to have Python 2.3.x in order to work with scipy 0.3.2? >Thanks. >-Vincent > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > From johan.nilsson at freenet.de Tue Aug 16 07:36:57 2005 From: johan.nilsson at freenet.de (Johan Nilsson) Date: Tue, 16 Aug 2005 13:36:57 +0200 Subject: [SciPy-user] Pyhton2.4 and SciPy In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> Message-ID: <1124192218.7565.5.camel@localhost.localdomain> I recently installed Ubuntu on an old Toshiba laptop. It came with Python 2.4.1 I Installed scipy 0.3.2 from the Synapitics package manager. scipy.test() gave the following Ran 972 tests in 20.113s OK Johan On Tue, 2005-08-16 at 12:08 +0100, Howey, David A wrote: > In my experience it only works with python 2.3 > > -----Original Message----- > From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] > On Behalf Of Vincent Alcouffe > Sent: 16 August 2005 10:55 > To: scipy-user at scipy.net > Subject: [SciPy-user] Pyhton2.4 and SciPy > > Hi all, > I've one question regarding Python version 2.4 and Scipy module version > 0.3.2. > Does the Python 2.4 works well with scipy 0.3.2? > Or is it needed to have Python 2.3.x in order to work with scipy 0.3.2? > Thanks. > -Vincent > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From d.howey at imperial.ac.uk Tue Aug 16 08:08:27 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Tue, 16 Aug 2005 13:08:27 +0100 Subject: [SciPy-user] Pyhton2.4 and SciPy Message-ID: <056D32E9B2D93B49B01256A88B3EB218766E9C@icex2.ic.ac.uk> Ok.. This must have been recently changed then, or this must be a windows problem. Dave -----Original Message----- From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] On Behalf Of Johan Nilsson Sent: 16 August 2005 12:37 To: SciPy Users List Subject: RE: [SciPy-user] Pyhton2.4 and SciPy I recently installed Ubuntu on an old Toshiba laptop. It came with Python 2.4.1 I Installed scipy 0.3.2 from the Synapitics package manager. scipy.test() gave the following Ran 972 tests in 20.113s OK Johan On Tue, 2005-08-16 at 12:08 +0100, Howey, David A wrote: > In my experience it only works with python 2.3 > > -----Original Message----- > From: scipy-user-bounces at scipy.net > [mailto:scipy-user-bounces at scipy.net] > On Behalf Of Vincent Alcouffe > Sent: 16 August 2005 10:55 > To: scipy-user at scipy.net > Subject: [SciPy-user] Pyhton2.4 and SciPy > > Hi all, > I've one question regarding Python version 2.4 and Scipy module > version 0.3.2. > Does the Python 2.4 works well with scipy 0.3.2? > Or is it needed to have Python 2.3.x in order to work with scipy 0.3.2? > Thanks. > -Vincent > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user From vincent.alcouffe at newlogic.fr Tue Aug 16 08:12:43 2005 From: vincent.alcouffe at newlogic.fr (Vincent Alcouffe) Date: Tue, 16 Aug 2005 14:12:43 +0200 Subject: [SciPy-user] Pyhton2.4 and SciPy In-Reply-To: <1124192218.7565.5.camel@localhost.localdomain> References: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> <1124192218.7565.5.camel@localhost.localdomain> Message-ID: <4301D83B.10603@newlogic.fr> Johan, What's this Synapitics package manager. Thanks. -Vincent Johan Nilsson wrote: > I recently installed Ubuntu on an old Toshiba laptop. It came with > Python 2.4.1 I Installed scipy 0.3.2 from the Synapitics package > manager. > > scipy.test() gave the following > > Ran 972 tests in 20.113s > > OK > > Johan > > On Tue, 2005-08-16 at 12:08 +0100, Howey, David A wrote: > >>In my experience it only works with python 2.3 >> >>-----Original Message----- >>From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] >>On Behalf Of Vincent Alcouffe >>Sent: 16 August 2005 10:55 >>To: scipy-user at scipy.net >>Subject: [SciPy-user] Pyhton2.4 and SciPy >> >>Hi all, >>I've one question regarding Python version 2.4 and Scipy module version >>0.3.2. >>Does the Python 2.4 works well with scipy 0.3.2? >>Or is it needed to have Python 2.3.x in order to work with scipy 0.3.2? >>Thanks. >>-Vincent >> >>_______________________________________________ >>SciPy-user mailing list >>SciPy-user at scipy.net >>http://www.scipy.net/mailman/listinfo/scipy-user >> >>_______________________________________________ >>SciPy-user mailing list >>SciPy-user at scipy.net >>http://www.scipy.net/mailman/listinfo/scipy-user > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From nwagner at mecha.uni-stuttgart.de Tue Aug 16 08:27:19 2005 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 16 Aug 2005 14:27:19 +0200 Subject: [SciPy-user] scipy via svn Message-ID: <4301DBA7.8070007@mecha.uni-stuttgart.de> Hi all, When attempting to install scipy via svn svn co http://svn.scipy.org/svn/scipy/trunk scipy python setup.py build in ~/svn/scipy results in Traceback (most recent call last): File "setup.py", line 47, in ? import scipy_distutils ImportError: No module named scipy_distutils What is missing here ? Nils From meesters at uni-mainz.de Tue Aug 16 08:48:46 2005 From: meesters at uni-mainz.de (Christian Meesters) Date: Tue, 16 Aug 2005 14:48:46 +0200 Subject: [SciPy-user] bug or feature Message-ID: Hi I'm using scipy 0.3.2 and run into troubles. To illustrate them just this: >>> x = None >>> if x: print 'hello' #nothing happens here ... >>> from scipy import * >>> a = array(None) >>> if a: print 'hello' #will print 'hello', why? ... hello >>> print a None I consider it a nice feature that no exception is raised when None is passed to array(), but apparently 'None' in Python is something different than 'None' in SciPy - or is it? Should I know about this? How should I deal with it? Asking with 'if' does not really work here to check whether an object 'really' exists. And using try/except for every possible case is not really feasible ... TIA Christian From nwagner at mecha.uni-stuttgart.de Tue Aug 16 08:49:50 2005 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 16 Aug 2005 06:49:50 -0600 Subject: [SciPy-user] scipy via svn In-Reply-To: <4301DBA7.8070007@mecha.uni-stuttgart.de> References: <4301DBA7.8070007@mecha.uni-stuttgart.de> Message-ID: <4301E0EE.205@mecha.uni-stuttgart.de> Nils Wagner wrote: >Hi all, > >When attempting to install scipy via svn > >svn co http://svn.scipy.org/svn/scipy/trunk scipy > >python setup.py build in ~/svn/scipy > >results in > > >Traceback (most recent call last): > File "setup.py", line 47, in ? > import scipy_distutils >ImportError: No module named scipy_distutils > >What is missing here ? > >Nils > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > I guess svn co http://svn.scipy.org/svn/scipy_core/trunk/ is missing. Is that correct ? Nils From ckkart at hoc.net Tue Aug 16 09:21:23 2005 From: ckkart at hoc.net (Christian Kristukat) Date: Tue, 16 Aug 2005 15:21:23 +0200 Subject: [SciPy-user] bug or feature In-Reply-To: References: Message-ID: <4301E853.1040908@hoc.net> Christian Meesters wrote: > Hi > > I'm using scipy 0.3.2 and run into troubles. To illustrate them just this: > > >>> x = None > >>> if x: print 'hello' #nothing happens here > ... > >>> from scipy import * > >>> a = array(None) > >>> if a: print 'hello' #will print 'hello', why? > ... > hello > >>> print a > None > > I consider it a nice feature that no exception is raised when None is > passed to array(), but apparently 'None' in Python is something > different than 'None' in SciPy - or is it? Should I know about this? How > should I deal with it? Asking with 'if' does not really work here to > check whether an object 'really' exists. And using try/except for every > possible case is not really feasible ... Calling type() in both cases yields: and so only the first is really None, the second is an array object which contains 'None'. You can check that with if a is array(None): print 'None' In what cases is that behaviour causing problems? Why do you need that kind of arrays? Regards, Christian From meesters at uni-mainz.de Tue Aug 16 09:32:13 2005 From: meesters at uni-mainz.de (Christian Meesters) Date: Tue, 16 Aug 2005 15:32:13 +0200 Subject: [SciPy-user] bug or feature In-Reply-To: <4301E853.1040908@hoc.net> References: <4301E853.1040908@hoc.net> Message-ID: > > Calling type() in both cases yields: > > > and > Oh yes. > > so only the first is really None, the second is an array object which > contains 'None'. You can check that with > if a is array(None): > print 'None' > > In what cases is that behaviour causing problems? Why do you need that > kind of arrays? I don't need it, but my class I'd like to initialize every instance object either with an array or None (or some meta data), depending on the data given by my detector. So, I guess the best solution is to initialize with None instead of using the array. Well sometimes I just have do admit that I don't see the wood for all the trees. Thanks for pointing this out to me. Regards, Christian From novak at ucolick.org Tue Aug 16 11:46:18 2005 From: novak at ucolick.org (Greg Novak) Date: Tue, 16 Aug 2005 08:46:18 -0700 (PDT) Subject: [SciPy-user] Re: CVS and SVN In-Reply-To: <20050816110846.8E4413EB63@www.scipy.com> References: <20050816110846.8E4413EB63@www.scipy.com> Message-ID: > svn co http://svn.scipy.org/svn/scipy/trunk scipy > svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython If you'd like to make your users lives significantly less exciting, this might be posted on the web site, perhaps in place of the now defunct CVS instructions. I eventualy found it on the mailing list, but not by using the scipy.org "search" function for the mailing lists. That just returned a bit of old discussion related to pros/cons of using svn. I found it with Google. It might also be good to replace the scipy.org "search" box with a site-specific Google search, since finding no useful results from the scipy.org search function was quite deceptive. Thanks, Greg From johan.nilsson at freenet.de Tue Aug 16 11:59:36 2005 From: johan.nilsson at freenet.de (Johan Nilsson) Date: Tue, 16 Aug 2005 17:59:36 +0200 Subject: [SciPy-user] Pyhton2.4 and SciPy In-Reply-To: <4301D83B.10603@newlogic.fr> References: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> <1124192218.7565.5.camel@localhost.localdomain> <4301D83B.10603@newlogic.fr> Message-ID: <1124207978.9066.4.camel@localhost.localdomain> Vincent, I am rather new to the Debian flavor of linux, but this seems to be an user friendlier interface towards apt-get. You have a user interface where you can brows the packages. /Johan On Tue, 2005-08-16 at 14:12 +0200, Vincent Alcouffe wrote: > Synapitics package manager From d.howey at imperial.ac.uk Tue Aug 16 13:01:08 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Tue, 16 Aug 2005 18:01:08 +0100 Subject: [SciPy-user] New book on python and engineering Message-ID: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> This book may be of interest to the list: http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521852870 "Numerical Methods in Engineering with Python Jaan Kiusalaas Pennsylvania State University" Looks pretty good, although why he ignores the object oriented nature of python, I know not (read the excerpt) Dave From europa100 at comcast.net Tue Aug 16 13:19:26 2005 From: europa100 at comcast.net (Rob) Date: Tue, 16 Aug 2005 10:19:26 -0700 Subject: [SciPy-user] New book on python and engineering In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> Message-ID: <4302201E.7030604@comcast.net> Howey, David A wrote: > > This book may be of interest to the list: > > http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521852870 > > "Numerical Methods in Engineering with Python > Jaan Kiusalaas > Pennsylvania State University" > > Looks pretty good, although why he ignores the object oriented nature of > python, I know not (read the excerpt) > > Dave > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > Wow, sounds like the marraige of my way old classic Numerical Methods book with a Python Manual. Will look for it, or check Amazon, they owe me some free books. Rob. From aisaac at american.edu Tue Aug 16 13:42:01 2005 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 16 Aug 2005 13:42:01 -0400 Subject: [SciPy-user] New book on python and engineering In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> Message-ID: On Tue, 16 Aug 2005, David A Howey apparently wrote: > http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521852870 > "Numerical Methods in Engineering with Python > Jaan Kiusalaas > Pennsylvania State University" > Looks pretty good, although why he ignores the object > oriented nature of python, I know not Numerical Methods in Engineering with MATLAB? Jaan Kiusalaas Hardback | Published September 2005 | Not yet published - available from September 2005 Cheers, Alan Isaac From andrew.fant at tufts.edu Tue Aug 16 13:55:22 2005 From: andrew.fant at tufts.edu (Andrew Fant) Date: Tue, 16 Aug 2005 13:55:22 -0400 Subject: [SciPy-user] New book on python and engineering In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> Message-ID: <4302288A.3000709@tufts.edu> Howey, David A wrote: > > This book may be of interest to the list: > > http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521852870 > > "Numerical Methods in Engineering with Python > Jaan Kiusalaas > Pennsylvania State University" > > Looks pretty good, although why he ignores the object oriented nature of > python, I know not (read the excerpt) I just looked on Amazon, and the second hit for "numerical methods python" was this book: "Python Scripting for Computational Science (Texts in Computational Science and Engineering)" Hans P. Langtangen Given that the price is similar to the aforementioned Numerical Methods text, has anyone from the list had a chance to read both of these yet, or even just the later? I'm trying to curb a nasty book-buying addiction, but I feel like I ought to get ONE of these. Any reviews or opinions from someone who has actually seen them would be really helpful. Thanks, Andy From dd55 at cornell.edu Tue Aug 16 14:17:07 2005 From: dd55 at cornell.edu (Darren Dale) Date: Tue, 16 Aug 2005 14:17:07 -0400 Subject: [SciPy-user] New book on python and engineering In-Reply-To: <4302288A.3000709@tufts.edu> References: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> <4302288A.3000709@tufts.edu> Message-ID: <200508161417.07379.dd55@cornell.edu> On Tuesday 16 August 2005 1:55 pm, Andrew Fant wrote: > Howey, David A wrote: > > This book may be of interest to the list: > > > > http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521852870 > > > > "Numerical Methods in Engineering with Python > > Jaan Kiusalaas > > Pennsylvania State University" > > > > Looks pretty good, although why he ignores the object oriented nature of > > python, I know not (read the excerpt) > > I just looked on Amazon, and the second hit for "numerical methods > python" was this book: > > "Python Scripting for Computational Science (Texts in Computational > Science and Engineering)" > Hans P. Langtangen > > Given that the price is similar to the aforementioned Numerical Methods > text, has anyone from the list had a chance to read both of these yet, > or even just the later? I'm trying to curb a nasty book-buying > addiction, but I feel like I ought to get ONE of these. Any reviews or > opinions from someone who has actually seen them would be really helpful. I have Python Scripting for Computational Science. I know it has been discussed before, either on this list, the matplotlib-users list, or the IPython list. It was more of an introduction to Python from a science and engineering perspective. It was good, but not as a numerical methods reference (though it did have a section on solving PDE's). It has one of the nicest binding jobs on my bookshelf, so theres that. Darren From guillem at torroja.dmt.upm.es Tue Aug 16 14:49:09 2005 From: guillem at torroja.dmt.upm.es (guillem at torroja.dmt.upm.es) Date: Tue, 16 Aug 2005 20:49:09 +0200 (CEST) Subject: [SciPy-user] New book on python and engineering In-Reply-To: <200508161417.07379.dd55@cornell.edu> References: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> <4302288A.3000709@tufts.edu> <200508161417.07379.dd55@cornell.edu> Message-ID: On Tue, 16 Aug 2005, Darren Dale wrote: > On Tuesday 16 August 2005 1:55 pm, Andrew Fant wrote: > > Howey, David A wrote: > > > This book may be of interest to the list: > > > > > > http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521852870 > > > > > > "Numerical Methods in Engineering with Python > > > Jaan Kiusalaas > > > Pennsylvania State University" > > > > > > Looks pretty good, although why he ignores the object oriented nature of > > > python, I know not (read the excerpt) > > > > I just looked on Amazon, and the second hit for "numerical methods > > python" was this book: > > > > "Python Scripting for Computational Science (Texts in Computational > > Science and Engineering)" > > Hans P. Langtangen > > > > Given that the price is similar to the aforementioned Numerical Methods > > text, has anyone from the list had a chance to read both of these yet, > > or even just the later? I'm trying to curb a nasty book-buying > > addiction, but I feel like I ought to get ONE of these. Any reviews or > > opinions from someone who has actually seen them would be really helpful. > > I have Python Scripting for Computational Science. I know it has been > discussed before, either on this list, the matplotlib-users list, or the > IPython list. It was more of an introduction to Python from a science and > engineering perspective. It was good, but not as a numerical methods > reference (though it did have a section on solving PDE's). It has one of the > nicest binding jobs on my bookshelf, so theres that. > > Darren I have Python Scripting for Computational Science too. It seems that this brand new book intends to be the "beginner's Matlab guide" rewriting all the scripts with Python. Python Scripting FCS is about Python and its resources. Talks more about using Python as a "gluing" language and building GUIs than solving numerical problems. I think it's a good book, more suitable for an experienced programmer. I took many examples from the book for some of my homework. It's just my oppinion but I think that trying to use Python just as a Matlab replacement is not the right path. I switched to Python because it is a richer language. Showing that Python is just more suitable would be better. Guillem From swisher at enthought.com Tue Aug 16 15:21:59 2005 From: swisher at enthought.com (Janet M. Swisher) Date: Tue, 16 Aug 2005 14:21:59 -0500 Subject: [SciPy-user] Re: CVS and SVN In-Reply-To: References: <20050816110846.8E4413EB63@www.scipy.com> Message-ID: <43023CD7.5090700@enthought.com> Greg Novak wrote: >> svn co http://svn.scipy.org/svn/scipy/trunk scipy >> svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython > > > If you'd like to make your users lives significantly less exciting, > this might be posted on the web site, perhaps in place of the now > defunct CVS instructions. > > I eventualy found it on the mailing list, but not by using the > scipy.org "search" function for the mailing lists. That just returned > a bit of old discussion related to pros/cons of using svn. I found it > with Google. It might also be good to replace the scipy.org "search" > box with a site-specific Google search, since finding no useful > results from the scipy.org search function was quite deceptive. > Good point, Greg. Thanks. I've added a note to the CVS instruction page, and will convert it to SVN instructions as soon as possible. -- Janet Swisher --- Senior Technical Writer Enthought, Inc. http://www.enthought.com From genietdev0 at iol.ie Tue Aug 16 15:52:01 2005 From: genietdev0 at iol.ie (Victor Reijs) Date: Tue, 16 Aug 2005 20:52:01 +0100 Subject: [SciPy-user] Pyhton2.4 and SciPy In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766E96@icex2.ic.ac.uk> Message-ID: <430243E1.1090501@iol.ie> Hello all of you, On my Windows XP Pro SP2 I was not able to het a working scipy (0.3.2) with python 2.2 (crashing python) or python 2.3 (restarting python). I was only able to get it working with enthought package (2.3.3-1057). All the best, Victor Howey, David A wrote: > In my experience it only works with python 2.3 > > -----Original Message----- > >>From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] > > On Behalf Of Vincent Alcouffe > Sent: 16 August 2005 10:55 > To: scipy-user at scipy.net > Subject: [SciPy-user] Pyhton2.4 and SciPy > > Hi all, > I've one question regarding Python version 2.4 and Scipy module version > 0.3.2. > Does the Python 2.4 works well with scipy 0.3.2? > Or is it needed to have Python 2.3.x in order to work with scipy 0.3.2? > Thanks. > -Vincent > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > From europa100 at comcast.net Tue Aug 16 17:09:47 2005 From: europa100 at comcast.net (Rob) Date: Tue, 16 Aug 2005 14:09:47 -0700 Subject: [SciPy-user] New book on python and engineering/ Matlab and Numeric array syntax, etc In-Reply-To: References: <056D32E9B2D93B49B01256A88B3EB218766EA0@icex2.ic.ac.uk> <4302288A.3000709@tufts.edu> <200508161417.07379.dd55@cornell.edu> Message-ID: <4302561B.9080709@comcast.net> guillem at torroja.dmt.upm.es wrote: > > On Tue, 16 Aug 2005, Darren Dale wrote: > > >>On Tuesday 16 August 2005 1:55 pm, Andrew Fant wrote: >> >>>Howey, David A wrote: >>> >>>>This book may be of interest to the list: >>>> >>>>http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521852870 >>>> >>>>"Numerical Methods in Engineering with Python >>>>Jaan Kiusalaas >>>>Pennsylvania State University" >>>> >>>>Looks pretty good, although why he ignores the object oriented nature of >>>>python, I know not (read the excerpt) >>> >>>I just looked on Amazon, and the second hit for "numerical methods >>>python" was this book: >>> >>>"Python Scripting for Computational Science (Texts in Computational >>>Science and Engineering)" >>>Hans P. Langtangen >>> >>>Given that the price is similar to the aforementioned Numerical Methods >>>text, has anyone from the list had a chance to read both of these yet, >>>or even just the later? I'm trying to curb a nasty book-buying >>>addiction, but I feel like I ought to get ONE of these. Any reviews or >>>opinions from someone who has actually seen them would be really helpful. >> >>I have Python Scripting for Computational Science. I know it has been >>discussed before, either on this list, the matplotlib-users list, or the >>IPython list. It was more of an introduction to Python from a science and >>engineering perspective. It was good, but not as a numerical methods >>reference (though it did have a section on solving PDE's). It has one of the >>nicest binding jobs on my bookshelf, so theres that. >> >>Darren > > > I have Python Scripting for Computational Science too. It seems that this > brand new book intends to be the "beginner's Matlab guide" rewriting all > the scripts with Python. Python Scripting FCS is about Python and its > resources. Talks more about using Python as a "gluing" language and > building GUIs than solving numerical problems. I think it's a good book, > more suitable for an experienced programmer. I took many > examples from the book for some of my homework. > > It's just my oppinion but I think that trying to use Python just as a > Matlab replacement is not the right path. I switched to Python because it > is a richer language. Showing that Python is just more suitable would be > better. > > Guillem > Hi all, I have never used Matlab, but doesn't it use similar or at least comparable array notation as Numeric? Perhaps I have no idea what I am talking about either. (I mean Matlab here, LOL) Rob From europa100 at comcast.net Tue Aug 16 21:10:47 2005 From: europa100 at comcast.net (Rob) Date: Tue, 16 Aug 2005 18:10:47 -0700 Subject: [SciPy-user] Numeric Python EM Project on wiki?? Message-ID: <43028E97.6060401@comcast.net> Hi, I put the Numeric Python EM Project on the wiki, but I may not have followed the directions, and I made an Electromagnics category. If people don't want this, I can put it way at the bottom in the really misc category. Sorry if I goofed it all up. Sincerely, Rob From Fernando.Perez at colorado.edu Tue Aug 16 23:16:52 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Tue, 16 Aug 2005 21:16:52 -0600 Subject: [SciPy-user] Numeric Python EM Project on wiki?? In-Reply-To: <43028E97.6060401@comcast.net> References: <43028E97.6060401@comcast.net> Message-ID: <4302AC24.6070703@colorado.edu> Rob wrote: > Hi, > > I put the Numeric Python EM Project on the wiki, but I may not have > followed the directions, and I made an Electromagnics category. If > people don't want this, I can put it way at the bottom in the really > misc category. Sorry if I goofed it all up. It's no problem, but if you've made a new category, you should move over there the other relevant stuff. At least the PyFemax link belongs there (you could also put internal links to FiPy and FEval, without moving those from Misc, since they can be of interest to people looking for EM stuff). Cheers, f From d.howey at imperial.ac.uk Wed Aug 17 06:35:26 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Wed, 17 Aug 2005 11:35:26 +0100 Subject: [SciPy-user] New book on python and engineering Message-ID: <056D32E9B2D93B49B01256A88B3EB218766EA1@icex2.ic.ac.uk> >It's just my oppinion but I think that trying to use Python just as a Matlab replacement is not the right path. >I switched to Python because it is a richer language. Showing that Python is just more suitable would be >better. I agree. It hasn't taken me long to switch from matlab to python, and from a programming language point of view, matlab now looks archaic. Separate files for every function you write! Clunky object implementation! Ouch. Python is a lot more elegant to write and look at. And frankly, with scipy, you're getting some ace mathematical tools. I'm finding python a lot better and easier than matlab for what I want to do. I guess for large organisations that have a lot of matlab code, it is easier to just keep using matlab; plus simulink is of course excellent. But I'm prefering python here... Dave From nwagner at mecha.uni-stuttgart.de Wed Aug 17 07:23:36 2005 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 17 Aug 2005 13:23:36 +0200 Subject: [SciPy-user] linalg.eigvals Message-ID: <43031E38.3030207@mecha.uni-stuttgart.de> Hi all, Is this a bug or a feature >>> A = mat(1) >>> linalg.eigvals(A) array([ 1.+0.j]) >>> A = array(([1])) >>> linalg.eigvals(A) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.4/site-packages/scipy/linalg/decomp.py", line 163, in eigvals return eig(a,b=b,left=0,right=0,overwrite_a=overwrite_a) File "/usr/lib/python2.4/site-packages/scipy/linalg/decomp.py", line 107, in eig raise ValueError, 'expected square matrix' ValueError: expected square matrix >>> Nils From pajer at iname.com Wed Aug 17 09:47:18 2005 From: pajer at iname.com (Gary) Date: Wed, 17 Aug 2005 09:47:18 -0400 Subject: [SciPy-user] linalg.eigvals In-Reply-To: <43031E38.3030207@mecha.uni-stuttgart.de> References: <43031E38.3030207@mecha.uni-stuttgart.de> Message-ID: <43033FE6.6060803@iname.com> Nils Wagner wrote: >Hi all, > >Is this a bug or a feature > > > >>>>A = mat(1) >>>>linalg.eigvals(A) >>>> >>>> >array([ 1.+0.j]) > > >>>>A = array(([1])) >>>>linalg.eigvals(A) >>>> >>>> >Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.4/site-packages/scipy/linalg/decomp.py", line >163, in eigvals > return eig(a,b=b,left=0,right=0,overwrite_a=overwrite_a) > File "/usr/lib/python2.4/site-packages/scipy/linalg/decomp.py", line >107, in eig > raise ValueError, 'expected square matrix' >ValueError: expected square matrix > > > > > I think you have a typo. Try A = array([[1]]) (notice the square brackets) -gary >Nils > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > > From swisher at enthought.com Wed Aug 17 11:55:45 2005 From: swisher at enthought.com (Janet M. Swisher) Date: Wed, 17 Aug 2005 10:55:45 -0500 Subject: [SciPy-user] Re: SciPy - Python 2.4 In-Reply-To: References: Message-ID: <43035E01.7070402@enthought.com> neil neilson wrote: > Question re SciPy. > Have downloaded and tried to install SciPy, no luck in doing so. > Seems that it is for Python 2.3 and will not load with Python 2.4. > How about updating SciPy to Python 2.4. > This may be my error in loading or whatever. > Not familiar with your posting procedures, please advise and send info > to: > neilnln at hotmail.com Hi Neil, You may get more helpful informed responses if you post to the user mailing list, scipy-user at scipy.net. The most recent discussion on this topic indicated that SciPy works with Python 2.4 on Linux, but not on Windows. Perhaps others can give you more details, or suggestions on making it work. -- Janet Swisher --- Senior Technical Writer Enthought, Inc. http://www.enthought.com From yaroslavvb at gmail.com Wed Aug 17 14:24:29 2005 From: yaroslavvb at gmail.com (Yaroslav Bulatov) Date: Wed, 17 Aug 2005 11:24:29 -0700 Subject: [SciPy-user] python.exe has generated errors and will be closed by Windows Message-ID: I got that error when I've installed SciPy and typed "import scipy" into Python shell. "python.exe has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created." I installed Python 2.3.5 and SciPy_complete-0.3.2.win32-py2.3-num23.5.exe The same thing would happen when I install SciPy compiled for PIII instead The following string is present in the raw stack dump during crash "C:\Python23\lib\site-packages\scipy_base\fastumath.pyd" Error log: Application exception occurred: App: (pid=1416) When: 8/17/2005 @ 11:05:20.764 Exception number: c0000005 (access violation) *----> System Information <----* Computer Name: KALMAN User Name: Administrator Number of Processors: 1 Processor Type: x86 Family 6 Model 7 Stepping 2 Windows 2000 Version: 5.0 Current Build: 2195 Service Pack: 4 Current Type: Uniprocessor Free Registered Organization: home Registered Owner: user *----> Task List <----* 0 Idle.exe 8 System.exe 164 SMSS.exe 188 CSRSS.exe 208 WINLOGON.exe 236 SERVICES.exe 248 LSASS.exe 436 svchost.exe 460 spoolsv.exe 488 dlsdbnt.exe 508 svchost.exe 544 regsvc.exe 580 mstask.exe 628 WinMgmt.exe 656 svchost.exe 668 dlpwdnt.exe 968 explorer.exe 1100 iTunesHelper.ex.exe 1140 dlpsp.exe 1152 iPodService.exe 276 wuauclt.exe 1416 python.exe 936 emacs.exe 1200 DRWTSN32.exe 0 _Total.exe (1D000000 - 1D005000) (77F80000 - 77FFB000) (1E000000 - 1E0F1000) (7C4E0000 - 7C599000) (77E10000 - 77E75000) (77F40000 - 77F7C000) (7C2D0000 - 7C332000) (77D30000 - 77DA1000) (782F0000 - 78538000) (77C70000 - 77CBA000) (77B50000 - 77BD9000) (78000000 - 78045000) (1E1E0000 - 1E1EE000) (6D3C0000 - 6D3D4000) State Dump for Thread Id 0x400 eax=1e005e10 ebx=00879ac0 ecx=00000000 edx=0000000e esi=0012ef24 edi=00000000 eip=6d3caed9 esp=0012ed08 ebp=0012ed28 iopl=0 nv up ei pl nz na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000202 function: 6d3caea7 a140223d6d mov eax,[6d3d2240] ds:6d3d2240=1e005b30 6d3caeac a33cfb3c6d mov [6d3cfb3c],eax ds:6d3cfb3c=1e005b30 6d3caeb1 a158223d6d mov eax,[6d3d2258] ds:6d3d2258=1e005db0 6d3caeb6 a35cfb3c6d mov [6d3cfb5c],eax ds:6d3cfb5c=1e005db0 6d3caebb a130223d6d mov eax,[6d3d2230] ds:6d3d2230=1e006850 6d3caec0 a37cfb3c6d mov [6d3cfb7c],eax ds:6d3cfb7c=1e006850 6d3caec5 a134223d6d mov eax,[6d3d2234] ds:6d3d2234=1e005df0 6d3caeca a39cfb3c6d mov [6d3cfb9c],eax ds:6d3cfb9c=1e005df0 6d3caecf a14c223d6d mov eax,[6d3d224c] ds:6d3d224c=1e005e10 6d3caed4 a3bcfb3c6d mov [6d3cfbbc],eax ds:6d3cfbbc=1e005e10 FAULT ->6d3caed9 8b4130 mov eax,[ecx+0x30] ds:00a79ee6=???????? 6d3caedc a3ecf03c6d mov [6d3cf0ec],eax ds:6d3cf0ec=00000000 6d3caee1 a32cf13c6d mov [6d3cf12c],eax ds:6d3cf12c=00000000 6d3caee6 a36cf13c6d mov [6d3cf16c],eax ds:6d3cf16c=00000000 6d3caeeb a3acf13c6d mov [6d3cf1ac],eax ds:6d3cf1ac=00000000 6d3caef0 a154223d6d mov eax,[6d3d2254] ds:6d3d2254=1e006050 6d3caef5 c70524f93c6de0153c6d ds:6d3cf924=00000000 mov dword ptr [6d3cf924],0x6d3c15e0 6d3caeff c70528f93c6de0153c6d ds:6d3cf928=00000000 mov dword ptr [6d3cf928],0x6d3c15e0 6d3caf09 a32cf93c6d mov [6d3cf92c],eax ds:6d3cf92c=00000000 6d3caf0e 8b4130 mov eax,[ecx+0x30] ds:00a79ee6=???????? 6d3caf11 a32cf23c6d mov [6d3cf22c],eax ds:6d3cf22c=00000000 6d3caf16 a12c223d6d mov eax,[6d3d222c] ds:6d3d222c=1e006030 *----> Stack Back Trace <----* FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name 0012ED28 6D3CC85F 0088C9C0 007D09A8 00879AC0 0086E430 ! 0012ED68 1E04A86F 00000003 007CBD70 0012EF24 0012EF2F ! 0012EF24 61625F79 662E6573 75747361 6874616D 007D1E00 !PyImport_AppendInittab 70696373 00000000 00000000 00000000 00000000 00000000 *----> Raw Stack Dump <----* 0012ed08 c0 9a 87 00 00 00 00 00 - 24 ef 12 00 38 63 03 1e ........$...8c.. 0012ed18 c0 c9 88 00 c0 9a 87 00 - 24 ef 12 00 00 00 00 00 ........$....... 0012ed28 68 ed 12 00 5f c8 3c 6d - c0 c9 88 00 a8 09 7d 00 h..._. This is somewhat off topic, but the readers of this list should be well qualified to answer. I'm having trouble getting scipy to compile on Fedora Core 4 (see my posting to the scipy-dev list for details), and this message seems to indicate that it's just not working at the moment: http://www.scipy.net/pipermail/scipy-dev/2005-June/003041.html Can people recommend a Linux distribution that "just works" for scientific computing? I'm asking the list because I expect that the audience is similar to me: comfortable using a command line, comfortable building software, but really not wanting to deal with debugging shared library problems. It would probably be better if people replied to me directly and then I will summarize the results and re-post to the list. It seems like this would avoid a lot of redundant posts and also the potential flame war. Thanks for any input, Greg From europa100 at comcast.net Wed Aug 17 15:55:09 2005 From: europa100 at comcast.net (Rob) Date: Wed, 17 Aug 2005 12:55:09 -0700 Subject: [SciPy-user] Numeric Python EM Project on wiki?? In-Reply-To: <4302AC24.6070703@colorado.edu> References: <43028E97.6060401@comcast.net> <4302AC24.6070703@colorado.edu> Message-ID: <4303961D.5020208@comcast.net> Fernando Perez wrote: > Rob wrote: > >> Hi, >> >> I put the Numeric Python EM Project on the wiki, but I may not have >> followed the directions, and I made an Electromagnics category. If >> people don't want this, I can put it way at the bottom in the really >> misc category. Sorry if I goofed it all up. > > > It's no problem, but if you've made a new category, you should move over > there the other relevant stuff. At least the PyFemax link belongs > there (you could also put internal links to FiPy and FEval, without > moving those from Misc, since they can be of interest to people looking > for EM stuff). > > Cheers, > > f > > I will do as the project wishes, but unfortunately, I have gotten the flu and probably am in not a very sharp mental state right now to do it. I hope I can just hold off a little bit on this. I have to say that I am no html widard, but I was very good at seeing the pattern in the site and then using copy and paste, and changing the html and adding it for my entry. Rob. From Fernando.Perez at colorado.edu Wed Aug 17 15:59:39 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Wed, 17 Aug 2005 13:59:39 -0600 Subject: [SciPy-user] Numeric Python EM Project on wiki?? In-Reply-To: <4303961D.5020208@comcast.net> References: <43028E97.6060401@comcast.net> <4302AC24.6070703@colorado.edu> <4303961D.5020208@comcast.net> Message-ID: <4303972B.9020907@colorado.edu> Rob wrote: > I will do as the project wishes, but unfortunately, I have gotten the > flu and probably am in not a very sharp mental state right now to do it. > I hope I can just hold off a little bit on this. I have to say that I > am no html widard, but I was very good at seeing the pattern in the site > and then using copy and paste, and changing the html and adding it for > my entry. No worries, it's no big deal (and anyone can fix it, it's a wiki after all). I meant my comment more as a simple, generic common senseguideline: when someone makes a new category (which is OK), they should make sure to collect in it all existing items which fall logically under that category. Otherwise it doesn't make much sense to have a category to begin with (especially if it's going to hold a single link). Regards, f From wjdandreta at att.net Wed Aug 17 18:12:47 2005 From: wjdandreta at att.net (Bill Dandreta) Date: Wed, 17 Aug 2005 18:12:47 -0400 Subject: [SciPy-user] Suggested Linux Distribution? In-Reply-To: References: Message-ID: <4303B65F.8020803@att.net> An HTML attachment was scrubbed... URL: From alopez at cds.caltech.edu Wed Aug 17 18:51:04 2005 From: alopez at cds.caltech.edu (Adrian L. Garcia-Lomana) Date: Wed, 17 Aug 2005 15:51:04 -0700 (PDT) Subject: [SciPy-user] installing problems Message-ID: <57893.131.215.42.222.1124319064.squirrel@www.cds.caltech.edu> Hi all, I have a problem installing SciPy. I'm sure is not a problem of SciPy but of my computer, but I am quite lost. When I execute as root "pyhton setup.py install", after a while, this is the error: gcc: Lib/xplt/src/play/x11/errors.c In file included from Lib/xplt/src/play/x11/errors.c:9: Lib/xplt/src/play/x11/playx.h:11:22: X11/Xlib.h: No such file or directory In file included from Lib/xplt/src/play/x11/errors.c:9: Lib/xplt/src/play/x11/playx.h:29: parse error before "Display" Lib/xplt/src/play/x11/playx.h:29: warning: no semicolon at end of struct or union Lib/xplt/src/play/x11/playx.h:31: warning: type defaults to `int' in declaration of `wm_protocols' Lib/xplt/src/play/x11/playx.h:31: warning: type defaults to `int' in declaration of `wm_delete' Lib/xplt/src/play/x11/playx.h:31: warning: data definition has no type or storage class Lib/xplt/src/play/x11/playx.h:34: parse error before '*' token Lib/xplt/src/play/x11/playx.h:34: warning: type defaults to `int' in declaration of `font' Lib/xplt/src/play/x11/playx.h:34: warning: data definition has no type or storage class Lib/xplt/src/play/x11/playx.h:38: parse error before "XFontStruct" Lib/xplt/src/play/x11/playx.h:38: warning: no semicolon at end of struct or union Lib/xplt/src/play/x11/playx.h:39: conflicting types for `font' Lib/xplt/src/play/x11/playx.h:34: previous declaration of `font' Lib/xplt/src/play/x11/playx.h:40: parse error before '}' token Lib/xplt/src/play/x11/playx.h:40: warning: type . . . . loseDisplay' Lib/xplt/src/play/x11/errors.c:50: dereferencing pointer to incomplete type error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Ibuild/temp.linux-i686-2.4/config_pygist -ILib/xplt/src/gist -ILib/xplt/src/play -ILib/xplt/src/play/unix -I/usr/local/include/python2.4 -c Lib/xplt/src/play/x11/errors.c -o build/temp.linux-i686-2.4/Lib/xplt/src/play/x11/errors.o -DGISTPATH="\"/usr/local/lib/python2.4/site-packages/scipy/xplt/gistdata\""" failed with exit status 1 [root at dhcp-222 SciPy_complete-0.3.2]# It seems that there is some problems with the X11 headers or libraries. What should I do to install them? My operating system is Red Hat 9.0 Thanks for your time, Adri?n. From ryanfedora at comcast.net Wed Aug 17 19:08:18 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Wed, 17 Aug 2005 19:08:18 -0400 Subject: [SciPy-user] installing problems In-Reply-To: <57893.131.215.42.222.1124319064.squirrel@www.cds.caltech.edu> References: <57893.131.215.42.222.1124319064.squirrel@www.cds.caltech.edu> Message-ID: <4303C362.8010008@comcast.net> You most likely need to install the X development packages. If RH9 is similar to Fedora Core, you ought to be able to go to add applications and from somewhere in the red hat menu and find the X development stuff somewhere. Otherwise if you use yum or apt-get, you ought to be able to search for x11-devel or something like that. Adrian L. Garcia-Lomana wrote: > Hi all, > > I have a problem installing SciPy. I'm sure is not a problem of SciPy but > of my computer, but I am quite lost. > > When I execute as root "pyhton setup.py install", after a while, this is > the error: > > gcc: Lib/xplt/src/play/x11/errors.c > In file included from Lib/xplt/src/play/x11/errors.c:9: > Lib/xplt/src/play/x11/playx.h:11:22: X11/Xlib.h: No such file or directory > In file included from Lib/xplt/src/play/x11/errors.c:9: > Lib/xplt/src/play/x11/playx.h:29: parse error before "Display" > Lib/xplt/src/play/x11/playx.h:29: warning: no semicolon at end of struct > or union > Lib/xplt/src/play/x11/playx.h:31: warning: type defaults to `int' in > declaration of `wm_protocols' > Lib/xplt/src/play/x11/playx.h:31: warning: type defaults to `int' in > declaration of `wm_delete' > Lib/xplt/src/play/x11/playx.h:31: warning: data definition has no type or > storage class > Lib/xplt/src/play/x11/playx.h:34: parse error before '*' token > Lib/xplt/src/play/x11/playx.h:34: warning: type defaults to `int' in > declaration of `font' > Lib/xplt/src/play/x11/playx.h:34: warning: data definition has no type or > storage class > Lib/xplt/src/play/x11/playx.h:38: parse error before "XFontStruct" > Lib/xplt/src/play/x11/playx.h:38: warning: no semicolon at end of struct > or union > Lib/xplt/src/play/x11/playx.h:39: conflicting types for `font' > Lib/xplt/src/play/x11/playx.h:34: previous declaration of `font' > Lib/xplt/src/play/x11/playx.h:40: parse error before '}' token > Lib/xplt/src/play/x11/playx.h:40: warning: type > . > . > . > . > loseDisplay' > Lib/xplt/src/play/x11/errors.c:50: dereferencing pointer to incomplete type > error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall > -Wstrict-prototypes -fPIC -Ibuild/temp.linux-i686-2.4/config_pygist > -ILib/xplt/src/gist -ILib/xplt/src/play -ILib/xplt/src/play/unix > -I/usr/local/include/python2.4 -c Lib/xplt/src/play/x11/errors.c -o > build/temp.linux-i686-2.4/Lib/xplt/src/play/x11/errors.o > -DGISTPATH="\"/usr/local/lib/python2.4/site-packages/scipy/xplt/gistdata\""" > failed with exit status 1 > [root at dhcp-222 SciPy_complete-0.3.2]# > > > It seems that there is some problems with the X11 headers or libraries. > What should I do to install them? > > My operating system is Red Hat 9.0 > > Thanks for your time, > > Adri?n. > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From alopez at cds.caltech.edu Wed Aug 17 20:33:49 2005 From: alopez at cds.caltech.edu (Adrian L. Garcia-Lomana) Date: Wed, 17 Aug 2005 17:33:49 -0700 (PDT) Subject: [SciPy-user] installing problems In-Reply-To: <4303C362.8010008@comcast.net> References: <57893.131.215.42.222.1124319064.squirrel@www.cds.caltech.edu> <4303C362.8010008@comcast.net> Message-ID: <59838.131.215.42.222.1124325229.squirrel@www.cds.caltech.edu> Thanks, it's working now. > You most likely need to install the X development packages. If RH9 is > similar to Fedora Core, you ought to be able to go to add applications > and from somewhere in the red hat menu and find the X development stuff > somewhere. Otherwise if you use yum or apt-get, you ought to be able to > search for x11-devel or something like that. > > Adrian L. Garcia-Lomana wrote: >> Hi all, >> >> I have a problem installing SciPy. I'm sure is not a problem of SciPy >> but >> of my computer, but I am quite lost. >> >> When I execute as root "pyhton setup.py install", after a while, this is >> the error: >> >> gcc: Lib/xplt/src/play/x11/errors.c >> In file included from Lib/xplt/src/play/x11/errors.c:9: >> Lib/xplt/src/play/x11/playx.h:11:22: X11/Xlib.h: No such file or >> directory >> In file included from Lib/xplt/src/play/x11/errors.c:9: >> Lib/xplt/src/play/x11/playx.h:29: parse error before "Display" >> Lib/xplt/src/play/x11/playx.h:29: warning: no semicolon at end of struct >> or union >> Lib/xplt/src/play/x11/playx.h:31: warning: type defaults to `int' in >> declaration of `wm_protocols' >> Lib/xplt/src/play/x11/playx.h:31: warning: type defaults to `int' in >> declaration of `wm_delete' >> Lib/xplt/src/play/x11/playx.h:31: warning: data definition has no type >> or >> storage class >> Lib/xplt/src/play/x11/playx.h:34: parse error before '*' token >> Lib/xplt/src/play/x11/playx.h:34: warning: type defaults to `int' in >> declaration of `font' >> Lib/xplt/src/play/x11/playx.h:34: warning: data definition has no type >> or >> storage class >> Lib/xplt/src/play/x11/playx.h:38: parse error before "XFontStruct" >> Lib/xplt/src/play/x11/playx.h:38: warning: no semicolon at end of struct >> or union >> Lib/xplt/src/play/x11/playx.h:39: conflicting types for `font' >> Lib/xplt/src/play/x11/playx.h:34: previous declaration of `font' >> Lib/xplt/src/play/x11/playx.h:40: parse error before '}' token >> Lib/xplt/src/play/x11/playx.h:40: warning: type >> . >> . >> . >> . >> loseDisplay' >> Lib/xplt/src/play/x11/errors.c:50: dereferencing pointer to incomplete >> type >> error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall >> -Wstrict-prototypes -fPIC -Ibuild/temp.linux-i686-2.4/config_pygist >> -ILib/xplt/src/gist -ILib/xplt/src/play -ILib/xplt/src/play/unix >> -I/usr/local/include/python2.4 -c Lib/xplt/src/play/x11/errors.c -o >> build/temp.linux-i686-2.4/Lib/xplt/src/play/x11/errors.o >> -DGISTPATH="\"/usr/local/lib/python2.4/site-packages/scipy/xplt/gistdata\""" >> failed with exit status 1 >> [root at dhcp-222 SciPy_complete-0.3.2]# >> >> >> It seems that there is some problems with the X11 headers or libraries. >> What should I do to install them? >> >> My operating system is Red Hat 9.0 >> >> Thanks for your time, >> >> Adri?n. >> >> _______________________________________________ >> SciPy-user mailing list >> SciPy-user at scipy.net >> http://www.scipy.net/mailman/listinfo/scipy-user >> > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From d.howey at imperial.ac.uk Thu Aug 18 07:14:47 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Thu, 18 Aug 2005 12:14:47 +0100 Subject: [SciPy-user] optimize.fsolve Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E71F@icex2.ic.ac.uk> Hi, I'm having trouble getting fsolve to work. Does this work in a similar way to matlab's fsolve? I thought I'd start with something really simple, just solving for where two lines cross (y = ax + b - twice). I implemented a function which takes a vector for x and y (ie. say x[0], x[1]) and 'solves' the two equations, returning F[0] and F[1]. I then call fsolve on this function... unfortunately it seems to just converge on whatever starting guess I give it, or go to massive numbers! Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryanfedora at comcast.net Thu Aug 18 08:19:39 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Thu, 18 Aug 2005 08:19:39 -0400 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E71F@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E71F@icex2.ic.ac.uk> Message-ID: <43047CDB.4080308@comcast.net> David, Here is a script that does what I think you are trying to do: from scipy.optimize import fsolve def myfunc(xin): a1=12.2 b1=3.0 a2=-2.7 b2=-3.5 y1=a1*xin+b1 y2=a2*xin+b2 return y2-y1 myres=fsolve(myfunc,3.3) print('Results:'+str(myres)) Looking at the docstring for fsolve (i.e. help scipy.optimize.fsolve in Ipython), fsolve is trying to find the where func(x)=0. So, the function needs to return a scalar value that is zero at the input values you are looking for. Ryan Howey, David A wrote: > Hi, > > I'm having trouble getting fsolve to work. Does this work in a similar way to matlab's fsolve? > > I thought I'd start with something really simple, just solving for where two lines cross (y = ax + b - twice). I implemented a function which takes a vector for x and y (ie. say x[0], x[1]) and 'solves' the two equations, returning F[0] and F[1]. > > I then call fsolve on this function... unfortunately it seems to just converge on whatever starting guess I give it, or go to massive numbers! > > Dave > > > > ------------------------------------------------------------------------ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From d.howey at imperial.ac.uk Thu Aug 18 09:04:44 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Thu, 18 Aug 2005 14:04:44 +0100 Subject: [SciPy-user] optimize.fsolve Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E721@icex2.ic.ac.uk> Thanks for this... interesting. What I'm trying to do eventually use fsolve to solve for two unknowns (call them p and v) in two non-linear equations (call them F1, F2). In matlab, one would define a vector function say myfunc returning a vector F with F(1) (first element in the vector) evaluating to the first equation and F(2) to the second. The function would accept a vector input, say x, which is = [ p ; v]. ie a vector of the two unknowns. Do you think scipy's fsolve can work on vectors (arrays) like this in the same way? Dave -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 2505 bytes Desc: not available URL: From ryanfedora at comcast.net Thu Aug 18 09:14:33 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Thu, 18 Aug 2005 09:14:33 -0400 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E721@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E721@icex2.ic.ac.uk> Message-ID: <430489B9.6060905@comcast.net> Yes, I think it is doing exactly what Matlab would do. You can have a vector input, you just need to have a scalar output that you are trying to drive to zero. Howey, David A wrote: > Thanks for this... interesting. > > What I'm trying to do eventually use fsolve to solve for two unknowns (call them p and v) in two non-linear equations (call them F1, F2). In matlab, one would define a vector function say myfunc returning a vector F with F(1) (first element in the vector) evaluating to the first equation and F(2) to the second. The function would accept a vector input, say x, which is = [ p ; v]. ie a vector of the two unknowns. > > Do you think scipy's fsolve can work on vectors (arrays) like this in the same way? > > Dave > > > ------------------------------------------------------------------------ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From d.howey at imperial.ac.uk Thu Aug 18 09:21:49 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Thu, 18 Aug 2005 14:21:49 +0100 Subject: [SciPy-user] optimize.fsolve Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E722@icex2.ic.ac.uk> page 18 of the scipy tutorial sheds more light on this. I don't think the output has to be scalar. ... gradually getting there! Dave -----Original Message----- From: scipy-user-bounces at scipy.net on behalf of Ryan Krauss Sent: Thu 18/08/2005 14:14 To: SciPy Users List Subject: Re: [SciPy-user] optimize.fsolve Yes, I think it is doing exactly what Matlab would do. You can have a vector input, you just need to have a scalar output that you are trying to drive to zero. Howey, David A wrote: > Thanks for this... interesting. > > What I'm trying to do eventually use fsolve to solve for two unknowns (call them p and v) in two non-linear equations (call them F1, F2). In matlab, one would define a vector function say myfunc returning a vector F with F(1) (first element in the vector) evaluating to the first equation and F(2) to the second. The function would accept a vector input, say x, which is = [ p ; v]. ie a vector of the two unknowns. > > Do you think scipy's fsolve can work on vectors (arrays) like this in the same way? > > Dave > > > ------------------------------------------------------------------------ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3017 bytes Desc: not available URL: From ryanfedora at comcast.net Thu Aug 18 09:28:44 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Thu, 18 Aug 2005 09:28:44 -0400 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E722@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E722@icex2.ic.ac.uk> Message-ID: <43048D0C.6090606@comcast.net> I guess I was wrong. Howey, David A wrote: > page 18 of the scipy tutorial sheds more light on this. I don't think the output has to be scalar. > ... gradually getting there! > Dave > > > -----Original Message----- > From: scipy-user-bounces at scipy.net on behalf of Ryan Krauss > Sent: Thu 18/08/2005 14:14 > To: SciPy Users List > Subject: Re: [SciPy-user] optimize.fsolve > > Yes, I think it is doing exactly what Matlab would do. You can have a > vector input, you just need to have a scalar output that you are trying > to drive to zero. > > Howey, David A wrote: > >>Thanks for this... interesting. >> >>What I'm trying to do eventually use fsolve to solve for two unknowns (call them p and v) in two non-linear equations (call them F1, F2). In matlab, one would define a vector function say myfunc returning a vector F with F(1) (first element in the vector) evaluating to the first equation and F(2) to the second. The function would accept a vector input, say x, which is = [ p ; v]. ie a vector of the two unknowns. >> >>Do you think scipy's fsolve can work on vectors (arrays) like this in the same way? >> >>Dave >> >> >>------------------------------------------------------------------------ >> >>_______________________________________________ >>SciPy-user mailing list >>SciPy-user at scipy.net >>http://www.scipy.net/mailman/listinfo/scipy-user > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > > > ------------------------------------------------------------------------ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From d.howey at imperial.ac.uk Thu Aug 18 09:36:51 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Thu, 18 Aug 2005 14:36:51 +0100 Subject: [SciPy-user] optimize.fsolve Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E724@icex2.ic.ac.uk> I still think the way that arrays are used in scipy/numeric can be a bit subtle. I wouldn't have cracked this unless I'd seen the example given in the tutorial, which uses out = [some function] out.append(the next component of the vector) obvious with hindsight, but my earlier attempt to use out[0] = .... out[1] = .... failed Dave -----Original Message----- From: scipy-user-bounces at scipy.net on behalf of Ryan Krauss Sent: Thu 18/08/2005 14:28 To: SciPy Users List Subject: Re: [SciPy-user] optimize.fsolve I guess I was wrong. Howey, David A wrote: > page 18 of the scipy tutorial sheds more light on this. I don't think the output has to be scalar. > ... gradually getting there! > Dave > -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 2709 bytes Desc: not available URL: From ryanfedora at comcast.net Thu Aug 18 09:46:55 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Thu, 18 Aug 2005 09:46:55 -0400 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E724@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E724@icex2.ic.ac.uk> Message-ID: <4304914F.4090703@comcast.net> You can do what you did as long as you initiate the list ahead of time with something like out=zeros((2,1),'f'). In [32]: out=zeros((2,1),'f') In [33]: out[0]=12.3 In [34]: out[1]=-123.34564 In [35]: out Out[35]: [[ 12.30000019,] [-123.34564209,]] Howey, David A wrote: > I still think the way that arrays are used in scipy/numeric can be a bit subtle. I wouldn't have cracked this unless I'd seen the example given in the tutorial, which uses > > out = [some function] > out.append(the next component of the vector) > > obvious with hindsight, but my earlier attempt to use > out[0] = .... > out[1] = .... > > failed > Dave > > > -----Original Message----- > From: scipy-user-bounces at scipy.net on behalf of Ryan Krauss > Sent: Thu 18/08/2005 14:28 > To: SciPy Users List > Subject: Re: [SciPy-user] optimize.fsolve > > I guess I was wrong. > > Howey, David A wrote: > >>page 18 of the scipy tutorial sheds more light on this. I don't think the output has to be scalar. >>... gradually getting there! >>Dave >> >> >> >>------------------------------------------------------------------------ >> >>_______________________________________________ >>SciPy-user mailing list >>SciPy-user at scipy.net >>http://www.scipy.net/mailman/listinfo/scipy-user From bgoli at sun.ac.za Thu Aug 18 09:47:13 2005 From: bgoli at sun.ac.za (Brett Olivier) Date: Thu, 18 Aug 2005 15:47:13 +0200 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <430489B9.6060905@comcast.net> References: <056D32E9B2D93B49B01256A88B3EB21835E721@icex2.ic.ac.uk> <430489B9.6060905@comcast.net> Message-ID: <200508181547.13833.bgoli@sun.ac.za> Hi This is a simple example but perhaps it will help: ###### import scipy x0 = 10.0 x2 = 0.0 init_val = [10,20] def DE_explicit_ss(s): sdot = scipy.zeros((2),'d') sdot[0] = (10.0*x0 - s[0])-(5.0*s[0] - s[1]) sdot[1] = (5.0*s[0] - s[1])-(s[1] - x2) return sdot sres = scipy.optimize.fsolve(DE_explicit_ss, init_val) print 'result' print sres ###### "fsolve" is a wrapper around MINPACK's hybrd and hybrj algorithms. From scipy/Lib/optimize/minpack/hybrd.f c the purpose of hybrd is to find a zero of a system of c n nonlinear functions in n variables by a modification c of the powell hybrid method. the user must provide a c subroutine which calculates the functions. the jacobian is c then calculated by a forward-difference approximation. Brett On Thursday 18 August 2005 15:14, Ryan Krauss wrote: > Yes, I think it is doing exactly what Matlab would do. You can have a > vector input, you just need to have a scalar output that you are trying > to drive to zero. > > Howey, David A wrote: > > Thanks for this... interesting. > > > > What I'm trying to do eventually use fsolve to solve for two unknowns > > (call them p and v) in two non-linear equations (call them F1, F2). In > > matlab, one would define a vector function say myfunc returning a vector > > F with F(1) (first element in the vector) evaluating to the first > > equation and F(2) to the second. The function would accept a vector > > input, say x, which is = [ p ; v]. ie a vector of the two unknowns. > > > > Do you think scipy's fsolve can work on vectors (arrays) like this in the > > same way? > > > > Dave > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- Brett G. Olivier Ph.D. Triple-J Group for Molecular Cell Physiology Stellenbosch University bgoli at sun dot ac dot za http://glue.jjj.sun.ac.za/~bgoli Tel +27-21-8082704 Fax +27-21-8085863 Mobile +27-82-7329306 I wouldn't be so paranoid if you weren't all out to get me!! From d.howey at imperial.ac.uk Thu Aug 18 10:26:07 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Thu, 18 Aug 2005 15:26:07 +0100 Subject: [SciPy-user] optimize.fsolve Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E725@icex2.ic.ac.uk> thanks for all your help Ryan and Brett. I have now got fsolve working in my code. You won't believe how overjoyed I am!!! (the simple things in life, eh..) one more general python question relating to parameter passing. With routines like fsolve, the additional arguments for the user-defined function are passed in in a tuple, eg args = (80000, 80000, 12.7) is it possible to do a hack to call the function directly, eg something like answer = myfunc(x, args) .. this doesn't work, but is there some kind of 'unpack' or something which will make the function think it's just getting positional arguments instead of a tuple? There must be a way, otherwise how would fsolve (etc etc) work? Dave -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 2653 bytes Desc: not available URL: From ryanfedora at comcast.net Thu Aug 18 10:57:34 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Thu, 18 Aug 2005 10:57:34 -0400 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E725@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E725@icex2.ic.ac.uk> Message-ID: <4304A1DE.9090008@comcast.net> That's a good question. I can think of some ways to hack it, but there must be a clean way. I just don't know what that is. My first hack idea would be to check if the second argument was a tuple and then deal its contents to the desired variables (arguments 3 through the end would have to have default values for this to work). Looking at the source to fsolve didn't provide any insight. It eventually calls something like retval = _minpack._hybrd(func,x0,args,full_output,xtol,maxfev,ml,mu,epsfcn,factor,diag) and _hybrd must be a fortran routine or something because I can't find it defined as Python anywhere. Ryan Howey, David A wrote: > thanks for all your help Ryan and Brett. > > I have now got fsolve working in my code. You won't believe how overjoyed I am!!! (the simple things in life, eh..) > > one more general python question relating to parameter passing. With routines like fsolve, the additional arguments for the user-defined function are passed in in a tuple, eg > args = (80000, 80000, 12.7) > > is it possible to do a hack to call the function directly, eg something like > answer = myfunc(x, args) > > .. this doesn't work, but is there some kind of 'unpack' or something which will make the function think it's just getting positional arguments instead of a tuple? > > There must be a way, otherwise how would fsolve (etc etc) work? > > Dave > > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From bgoli at sun.ac.za Thu Aug 18 11:17:31 2005 From: bgoli at sun.ac.za (Brett Olivier) Date: Thu, 18 Aug 2005 17:17:31 +0200 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E725@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E725@icex2.ic.ac.uk> Message-ID: <200508181717.31585.bgoli@sun.ac.za> On Thursday 18 August 2005 16:26, Howey, David A wrote: > is it possible to do a hack to call the function directly, eg something > like answer = myfunc(x, args) I think you can do something like this. def DE_explicit_ss(s, x0, x2): scipy.optimize.fsolve(DE_explicit_ss, init_val, args=(x0,x2)) > .. this doesn't work, but is there some kind of 'unpack' or something which > will make the function think it's just getting positional arguments instead > of a tuple? > > There must be a way, otherwise how would fsolve (etc etc) work? > > Dave -- Brett G. Olivier Postdoctoral Fellow Triple-J Group for Molecular Cell Physiology Stellenbosch University bgoli at sun dot ac dot za http://glue.jjj.sun.ac.za/~bgoli Tel +27-21-8082704 Fax +27-21-8085863 Mobile +27-82-7329306 The only "intuitive" interface is the nipple. After that, it's all learned. (Bruce Ediger, bediger at teal.csn.org, in comp.os.linux.misc, on X interfaces.) From ckkart at hoc.net Thu Aug 18 12:18:46 2005 From: ckkart at hoc.net (Christian Kristukat) Date: Thu, 18 Aug 2005 18:18:46 +0200 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <056D32E9B2D93B49B01256A88B3EB21835E725@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB21835E725@icex2.ic.ac.uk> Message-ID: <4304B4E6.2050503@hoc.net> Howey, David A wrote: > thanks for all your help Ryan and Brett. > > I have now got fsolve working in my code. You won't believe how overjoyed I am!!! (the simple things in life, eh..) > > one more general python question relating to parameter passing. With routines like fsolve, the additional arguments for the user-defined function are passed in in a tuple, eg > args = (80000, 80000, 12.7) > > is it possible to do a hack to call the function directly, eg something like > answer = myfunc(x, args) def myfunc(x, *args): arg1,arg2 = args ... myfunc(*(100,-3)) Regards, Christian From rmuller at sandia.gov Thu Aug 18 16:38:59 2005 From: rmuller at sandia.gov (Rick Muller) Date: Thu, 18 Aug 2005 14:38:59 -0600 Subject: [SciPy-user] Pointers installing scipy on OS X Message-ID: <2df1b59db0070306c99ca9c7925fc922@sandia.gov> I'm having trouble installing scipy on my OS X computer. I have been following the excellent instructions at: http://www.scipy.org/documentation/Members/fonnesbeck/osx_build.txt but I'm still having problems. When I try to config/build scipy I get the following error message. Does anyone have any hints? I'm using version 0.3.2. Thanks in advance, Rick In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:133: warning: implicit declaration of function `nonstandard_arithmetic' fpuset.c:134: warning: implicit declaration of function `ieee_handler' Traceback (most recent call last): File "setup.py", line 112, in ? setup_package(ignore_packages) File "setup.py", line 85, in setup_package ignore_packages = ignore_packages) File "scipy_core/scipy_distutils/misc_util.py", line 475, in get_subpackages config = setup_module.configuration(*args) File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/setup_xplt.py", line 210, in configuration conf.run() File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/config_pygist.py", line 64, in run self.config_unix() File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/config_pygist.py", line 193, in config_unix self.find_sigfpe(configfile) File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/config_pygist.py", line 311, in find_sigfpe include_dirs=self.unix_include_dirs): File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/distutils/command/config.py", line 260, in try_link libraries, library_dirs, lang) File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/config_pygist.py", line 28, in _link library_dirs=library_dirs) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/distutils/ccompiler.py", line 860, in link_executable debug, extra_preargs, extra_postargs, None, target_lang) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/distutils/unixccompiler.py", line 153, in link libraries) File "scipy_core/scipy_distutils/ccompiler.py", line 266, in gen_lib_options runtime_library_dirs, libraries) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/distutils/ccompiler.py", line 1249, in gen_lib_options (lib_dir, lib_name) = os.path.split (lib) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/posixpath.py", line 77, in split i = p.rfind('/') + 1 AttributeError: 'NoneType' object has no attribute 'rfind' From lanceboyle at cwazy.co.uk Thu Aug 18 22:59:29 2005 From: lanceboyle at cwazy.co.uk (Lance Boyle) Date: Thu, 18 Aug 2005 19:59:29 -0700 Subject: [SciPy-user] Pointers installing scipy on OS X In-Reply-To: <2df1b59db0070306c99ca9c7925fc922@sandia.gov> References: <2df1b59db0070306c99ca9c7925fc922@sandia.gov> Message-ID: <7BD868A2-48CF-4BBC-90F8-329D79289414@cwazy.co.uk> On Aug 18, 2005, at 1:38 PM, Rick Muller wrote: > I'm having trouble installing scipy on my OS X computer. > > I have been following the excellent instructions at: > http://www.scipy.org/documentation/Members/fonnesbeck/osx_build.txt > but I'm still having problems. > This isn't The Macintosh Way; it's the unix way. I wonder if someone could make a proper installer. Jerry From fonnesbeck at gmail.com Thu Aug 18 23:04:18 2005 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Thu, 18 Aug 2005 23:04:18 -0400 Subject: [SciPy-user] Pointers installing scipy on OS X In-Reply-To: <7BD868A2-48CF-4BBC-90F8-329D79289414@cwazy.co.uk> References: <2df1b59db0070306c99ca9c7925fc922@sandia.gov> <7BD868A2-48CF-4BBC-90F8-329D79289414@cwazy.co.uk> Message-ID: <723eb69305081820044eccd7bb@mail.gmail.com> On 8/18/05, Lance Boyle wrote: > > On Aug 18, 2005, at 1:38 PM, Rick Muller wrote: > > > I'm having trouble installing scipy on my OS X computer. > > > > I have been following the excellent instructions at: > > http://www.scipy.org/documentation/Members/fonnesbeck/osx_build.txt > > but I'm still having problems. > > > > This isn't The Macintosh Way; it's the unix way. > > I wonder if someone could make a proper installer. > > Jerry I dont buy that -- it implies mac users are dolts that cant compile their own software. If you are using scipy, you are likely a scientist and should be expected to type "python setup.py install" occasionally. Rick, could you provide the full output from your attempted build -- that will help me diagnose the problem. Chris From ryanfedora at comcast.net Fri Aug 19 00:42:08 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Fri, 19 Aug 2005 00:42:08 -0400 Subject: [SciPy-user] optimize.fsolve In-Reply-To: <4304B4E6.2050503@hoc.net> References: <056D32E9B2D93B49B01256A88B3EB21835E725@icex2.ic.ac.uk> <4304B4E6.2050503@hoc.net> Message-ID: <43056320.3010209@comcast.net> Without having to do the unpacking manually you can also do this: In [12]: def myfunc(x,y,z):return x+y+z ....: In [13]: myargs=(3,5) In [14]: myfunc(2,*myargs) Out[14]: 10 (I was just reading in "Python in a Nutshell" tonight about how *seq can be used for positional arguments and **dict can be used for keyword arguments and Python will unpack them for you). Christian Kristukat wrote: > Howey, David A wrote: > >> thanks for all your help Ryan and Brett. >> >> I have now got fsolve working in my code. You won't believe how >> overjoyed I am!!! (the simple things in life, eh..) >> >> one more general python question relating to parameter passing. With >> routines like fsolve, the additional arguments for the user-defined >> function are passed in in a tuple, eg >> args = (80000, 80000, 12.7) >> >> is it possible to do a hack to call the function directly, eg >> something like >> answer = myfunc(x, args) > > > def myfunc(x, *args): > arg1,arg2 = args > ... > > myfunc(*(100,-3)) > > Regards, Christian > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From novak at ucolick.org Fri Aug 19 02:56:12 2005 From: novak at ucolick.org (Greg Novak) Date: Thu, 18 Aug 2005 23:56:12 -0700 (PDT) Subject: [SciPy-user] Scipy/Numeric slow under Debian? Message-ID: I recently had trouble getting Scipy to work under Fedora 4, and this drove me to try Debian. Now, apt-get python-scipy gets me going just fine, but it seems rather... slow. Code seems to run about a factor of 10 slower than when I had Scipy running under Fedora 3. I'm using Debian stable on a dual Intel Xeon 2.8 Ghz. The version of scipy that I got when I installed through apt was 0.3.2. The slow code is heavy on Numeric calls like argsort and cumsum, without much linear algebra. It seems to me that the culprit could be: 1) Compiler optimization 2) instruction set (i386 vs. i686) 3) kernel version (2.4 vs 2.6) 4) Some obscure hardware problem, like Debian isn't using some fancy memory-bandwidth enhancing feature that Fedora did (pure conjecture). All of the above seem unlikely to account for a factor of 10 speed difference. Any insight about what's going on would be much appreciated... Thanks, Greg From rkern at ucsd.edu Fri Aug 19 03:17:46 2005 From: rkern at ucsd.edu (Robert Kern) Date: Fri, 19 Aug 2005 00:17:46 -0700 Subject: [SciPy-user] Scipy/Numeric slow under Debian? In-Reply-To: References: Message-ID: <4305879A.90509@ucsd.edu> Greg Novak wrote: > I recently had trouble getting Scipy to work under Fedora 4, and this > drove me to try Debian. Now, apt-get python-scipy gets me going just > fine, but it seems rather... slow. Code seems to run about a factor of > 10 slower than when I had Scipy running under Fedora 3. > > I'm using Debian stable on a dual Intel Xeon 2.8 Ghz. The version of > scipy that I got when I installed through apt was 0.3.2. The slow code > is heavy on Numeric calls like argsort and cumsum, without much linear > algebra. It seems to me that the culprit could be: > 1) Compiler optimization > 2) instruction set (i386 vs. i686) > 3) kernel version (2.4 vs 2.6) > 4) Some obscure hardware problem, like Debian isn't using some fancy > memory-bandwidth enhancing feature that Fedora did (pure conjecture). > > All of the above seem unlikely to account for a factor of 10 speed > difference. Any insight about what's going on would be much appreciated... We won't have any until you give us some more information. I recommend writing some small targetted benchmarks testing individual operations under various conditions (like array size). It's possible that rebuilding the relevant packages locally with tweaked compiler flags might help. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From rmuller at sandia.gov Fri Aug 19 07:03:35 2005 From: rmuller at sandia.gov (Rick Muller) Date: Fri, 19 Aug 2005 05:03:35 -0600 Subject: [SciPy-user] Pointers installing scipy on OS X In-Reply-To: <723eb69305081820044eccd7bb@mail.gmail.com> References: <2df1b59db0070306c99ca9c7925fc922@sandia.gov> <7BD868A2-48CF-4BBC-90F8-329D79289414@cwazy.co.uk> <723eb69305081820044eccd7bb@mail.gmail.com> Message-ID: <7864f53f0721bc001564ce36aa5ecc5b@sandia.gov> On Aug 18, 2005, at 9:04 PM, Chris Fonnesbeck wrote: > > Rick, could you provide the full output from your attempted build -- > that will help me diagnose the problem. > Attached. Thanks very much for looking. fftw_info: FOUND: libraries = ['rfftw', 'fftw'] library_dirs = ['/usr/local/lib'] define_macros = [('SCIPY_FFTW_H', None)] include_dirs = ['/usr/local/include'] djbfft_info: NOT AVAILABLE DJBFFT (http://cr.yp.to/djbfft.html) libraries not found. Directories to search for the libraries can be specified in the scipy_distutils/site.cfg file (section [djbfft]) or by setting the DJBFFT environment variable. blas_opt_info: FOUND: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] define_macros = [('NO_ATLAS_INFO', 3)] extra_compile_args = ['-faltivec', '-framework', 'Accelerate'] lapack_opt_info: FOUND: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] define_macros = [('NO_ATLAS_INFO', 3)] extra_compile_args = ['-faltivec', '-framework', 'Accelerate'] creating build creating build/temp.darwin-7.9.0-Power_Macintosh-2.3 creating build/temp.darwin-7.9.0-Power_Macintosh-2.3/config_pygist ============= begin top level configuration ============= compiling '_configtest.c': /* check whether libm is broken */ #include int main(int argc, char *argv[]) { return exp(-720.) > 1.0; /* typically an IEEE denormal */ } gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-c' gcc: _configtest.c gcc _configtest.o -o _configtest success! removing: _configtest.c _configtest.o _configtest compiling '_configtest.c': /* check whether libm is broken */ #include int main(int argc, char *argv[]) { return exp(-720.) > 1.0; /* typically an IEEE denormal */ } gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-c' gcc: _configtest.c gcc _configtest.o -o _configtest _configtest success! removing: _configtest.c _configtest.o _configtest No libm needed. compiling '_configtest.c': int main(int argc, char *argv[]) { double x=exp10(3.); return (x<999.999)||(x>1000.001); } gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-c' gcc: _configtest.c _configtest.c: In function `main': _configtest.c:3: warning: implicit declaration of function `exp10' gcc _configtest.o -o _configtest ld: Undefined symbols: _exp10 ld: Undefined symbols: _exp10 failure. removing: _configtest.c _configtest.o libm does not contain exp10, will emulate ============= begin play/unix configuration ============= compiling '_configtest.c': #define USE_GETRUSAGE /* check settings of: USE_GETRUSAGE USE_TIMES */ #define CONFIG_SCRIPT #include "timeu.c" int main(int argc, char *argv[]) { double s; double t = p_cpu_secs(&s); return 0; } gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/rmuller/Python/scipy-0.3.2/build/temp.darwin-7.9.0- Power_Macintosh-2.3/config_pygist -I/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/src/play -c' gcc: _configtest.c _configtest.c: In function `main': _configtest.c:9: warning: unused variable `t' gcc _configtest.o -o _configtest success! removing: _configtest.c _configtest.o _configtest using getrusage() (CPU timer) compiling '_configtest.c': #define USE_GETTIMEOFDAY /* check settings of: USE_GETTIMEOFDAY */ #define CONFIG_SCRIPT #include "timew.c" int main(int argc, char *argv[]) { double t = p_wall_secs(); return 0; } gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/rmuller/Python/scipy-0.3.2/build/temp.darwin-7.9.0- Power_Macintosh-2.3/config_pygist -I/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/src/play -c' gcc: _configtest.c _configtest.c: In function `main': _configtest.c:8: warning: unused variable `t' gcc _configtest.o -o _configtest success! removing: _configtest.c _configtest.o _configtest using gettimeofday() (wall timer) compiling '_configtest.c': #define FPU_DIGITAL #define CONFIG_SCRIPT #include "fputest.c" gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/rmuller/Python/scipy-0.3.2/build/temp.darwin-7.9.0- Power_Macintosh-2.3/config_pygist -I/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/src/play -c' gcc: _configtest.c In file included from fputest.c:10, from _configtest.c:3: fpuset.c:27:27: machine/fpu.h: No such file or directory In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:45: warning: implicit declaration of function `ieee_set_fp_control' fpuset.c:45: error: `IEEE_TRAP_ENABLE_INV' undeclared (first use in this function) fpuset.c:45: error: (Each undeclared identifier is reported only once fpuset.c:45: error: for each function it appears in.) fpuset.c:45: error: `IEEE_TRAP_ENABLE_DZE' undeclared (first use in this function) fpuset.c:46: error: `IEEE_TRAP_ENABLE_OVF' undeclared (first use in this function) In file included from fputest.c:10, from _configtest.c:3: fpuset.c:27:27: machine/fpu.h: No such file or directory In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:45: warning: implicit declaration of function `ieee_set_fp_control' fpuset.c:45: error: `IEEE_TRAP_ENABLE_INV' undeclared (first use in this function) fpuset.c:45: error: (Each undeclared identifier is reported only once fpuset.c:45: error: for each function it appears in.) fpuset.c:45: error: `IEEE_TRAP_ENABLE_DZE' undeclared (first use in this function) fpuset.c:46: error: `IEEE_TRAP_ENABLE_OVF' undeclared (first use in this function) failure. removing: _configtest.c _configtest.o compiling '_configtest.c': #define FPU_AIX #define CONFIG_SCRIPT #include "fputest.c" gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/rmuller/Python/scipy-0.3.2/build/temp.darwin-7.9.0- Power_Macintosh-2.3/config_pygist -I/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/src/play -c' gcc: _configtest.c In file included from fputest.c:10, from _configtest.c:3: fpuset.c:53:20: fptrap.h: No such file or directory In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:58: warning: implicit declaration of function `fp_trap' fpuset.c:58: error: `FP_TRAP_FASTMODE' undeclared (first use in this function) fpuset.c:58: error: (Each undeclared identifier is reported only once fpuset.c:58: error: for each function it appears in.) fpuset.c:59: warning: implicit declaration of function `fp_enable' fpuset.c:59: error: `TRP_INVALID' undeclared (first use in this function) fpuset.c:59: error: `TRP_DIV_BY_ZERO' undeclared (first use in this function) fpuset.c:59: error: `TRP_OVERFLOW' undeclared (first use in this function) In file included from fputest.c:10, from _configtest.c:3: fpuset.c:53:20: fptrap.h: No such file or directory In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:58: warning: implicit declaration of function `fp_trap' fpuset.c:58: error: `FP_TRAP_FASTMODE' undeclared (first use in this function) fpuset.c:58: error: (Each undeclared identifier is reported only once fpuset.c:58: error: for each function it appears in.) fpuset.c:59: warning: implicit declaration of function `fp_enable' fpuset.c:59: error: `TRP_INVALID' undeclared (first use in this function) fpuset.c:59: error: `TRP_DIV_BY_ZERO' undeclared (first use in this function) fpuset.c:59: error: `TRP_OVERFLOW' undeclared (first use in this function) failure. removing: _configtest.c _configtest.o compiling '_configtest.c': #define FPU_HPUX #define CONFIG_SCRIPT #include "fputest.c" gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/rmuller/Python/scipy-0.3.2/build/temp.darwin-7.9.0- Power_Macintosh-2.3/config_pygist -I/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/src/play -c' gcc: _configtest.c In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:76: warning: implicit declaration of function `fpsetmask' fpuset.c:76: error: `FP_X_INV' undeclared (first use in this function) fpuset.c:76: error: (Each undeclared identifier is reported only once fpuset.c:76: error: for each function it appears in.) fpuset.c:76: error: `FP_X_DZ' undeclared (first use in this function) fpuset.c:76: error: `FP_X_OFL' undeclared (first use in this function) fpuset.c:77: warning: implicit declaration of function `fpsetfastmode' In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:76: warning: implicit declaration of function `fpsetmask' fpuset.c:76: error: `FP_X_INV' undeclared (first use in this function) fpuset.c:76: error: (Each undeclared identifier is reported only once fpuset.c:76: error: for each function it appears in.) fpuset.c:76: error: `FP_X_DZ' undeclared (first use in this function) fpuset.c:76: error: `FP_X_OFL' undeclared (first use in this function) fpuset.c:77: warning: implicit declaration of function `fpsetfastmode' failure. removing: _configtest.c _configtest.o compiling '_configtest.c': #define FPU_SOLARIS #define CONFIG_SCRIPT #include "fputest.c" gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/rmuller/Python/scipy-0.3.2/build/temp.darwin-7.9.0- Power_Macintosh-2.3/config_pygist -I/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/src/play -c' gcc: _configtest.c In file included from fputest.c:10, from _configtest.c:3: fpuset.c:103:20: ieeefp.h: No such file or directory In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:108: warning: implicit declaration of function `fpsetmask' fpuset.c:108: error: `FP_X_INV' undeclared (first use in this function) fpuset.c:108: error: (Each undeclared identifier is reported only once fpuset.c:108: error: for each function it appears in.) fpuset.c:108: error: `FP_X_DZ' undeclared (first use in this function) fpuset.c:108: error: `FP_X_OFL' undeclared (first use in this function) In file included from fputest.c:10, from _configtest.c:3: fpuset.c:103:20: ieeefp.h: No such file or directory In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:108: warning: implicit declaration of function `fpsetmask' fpuset.c:108: error: `FP_X_INV' undeclared (first use in this function) fpuset.c:108: error: (Each undeclared identifier is reported only once fpuset.c:108: error: for each function it appears in.) fpuset.c:108: error: `FP_X_DZ' undeclared (first use in this function) fpuset.c:108: error: `FP_X_OFL' undeclared (first use in this function) failure. removing: _configtest.c _configtest.o compiling '_configtest.c': #define FPU_SUN4 #define CONFIG_SCRIPT #include "fputest.c" gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/rmuller/Python/scipy-0.3.2/build/temp.darwin-7.9.0- Power_Macintosh-2.3/config_pygist -I/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/src/play -c' gcc: _configtest.c In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:133: warning: implicit declaration of function `nonstandard_arithmetic' fpuset.c:134: warning: implicit declaration of function `ieee_handler' Traceback (most recent call last): File "setup.py", line 112, in ? setup_package(ignore_packages) File "setup.py", line 85, in setup_package ignore_packages = ignore_packages) File "scipy_core/scipy_distutils/misc_util.py", line 475, in get_subpackages config = setup_module.configuration(*args) File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/setup_xplt.py", line 210, in configuration conf.run() File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/config_pygist.py", line 64, in run self.config_unix() File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/config_pygist.py", line 193, in config_unix self.find_sigfpe(configfile) File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/config_pygist.py", line 311, in find_sigfpe include_dirs=self.unix_include_dirs): File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/distutils/command/config.py", line 260, in try_link libraries, library_dirs, lang) File "/Users/rmuller/Python/scipy-0.3.2/Lib/xplt/config_pygist.py", line 28, in _link library_dirs=library_dirs) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/distutils/ccompiler.py", line 860, in link_executable debug, extra_preargs, extra_postargs, None, target_lang) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/distutils/unixccompiler.py", line 153, in link libraries) File "scipy_core/scipy_distutils/ccompiler.py", line 266, in gen_lib_options runtime_library_dirs, libraries) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/distutils/ccompiler.py", line 1249, in gen_lib_options (lib_dir, lib_name) = os.path.split (lib) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/posixpath.py", line 77, in split i = p.rfind('/') + 1 AttributeError: 'NoneType' object has no attribute 'rfind' From fonnesbeck at gmail.com Fri Aug 19 09:52:49 2005 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Fri, 19 Aug 2005 09:52:49 -0400 Subject: [SciPy-user] Pointers installing scipy on OS X In-Reply-To: <7864f53f0721bc001564ce36aa5ecc5b@sandia.gov> References: <2df1b59db0070306c99ca9c7925fc922@sandia.gov> <7BD868A2-48CF-4BBC-90F8-329D79289414@cwazy.co.uk> <723eb69305081820044eccd7bb@mail.gmail.com> <7864f53f0721bc001564ce36aa5ecc5b@sandia.gov> Message-ID: <723eb693050819065225478618@mail.gmail.com> On 8/19/05, Rick Muller wrote: > > On Aug 18, 2005, at 9:04 PM, Chris Fonnesbeck wrote: > > > > Rick, could you provide the full output from your attempted build -- > > that will help me diagnose the problem. > > > > Attached. Thanks very much for looking. > Rick, Try disabling xplt (you probably want to use gplt instead anyhow) by adding it to the ignore_packages list as a string (at the end of the setup.py file. Then try a clean build. C. From alopez at cds.caltech.edu Fri Aug 19 14:06:31 2005 From: alopez at cds.caltech.edu (Adrian L. Garcia-Lomana) Date: Fri, 19 Aug 2005 11:06:31 -0700 (PDT) Subject: [SciPy-user] DAE Message-ID: <35379.131.215.42.222.1124474791.squirrel@www.cds.caltech.edu> Hi, Although I've been using Python since last year I've just discovered SciPy. My daily work is on Ordinary Differential Equations and optimization. I was using Octave for the ODEs. But, in just one day I'm running odeint from SciPy and it works much faster than Octave and I don't need to call any external program. Then, congratulations to whoever is responsible for this. Now, I was wondering how could SciPy deal with Differential-Algebraic Equations? I'm reading the documentation but I haven't found anything specific. Does anybody work on this topic? To be more specific I'm interested in solving numerically systems like this: xdot1 = -k1 * x1 xdot2 = k2 * x1 xdot3 = -k3 * x3 xdot4 = k4 * x3 x3 = k5 * r / (1 + k5) r = x2 + x3 k5 = k3 /k2 Should I code this myself somehow? There is anything specific for DAE on SciPy? Any ideas/suggestions? Thanks for your time, Adri?n. From rkern at ucsd.edu Fri Aug 19 14:26:22 2005 From: rkern at ucsd.edu (Robert Kern) Date: Fri, 19 Aug 2005 11:26:22 -0700 Subject: [SciPy-user] DAE In-Reply-To: <35379.131.215.42.222.1124474791.squirrel@www.cds.caltech.edu> References: <35379.131.215.42.222.1124474791.squirrel@www.cds.caltech.edu> Message-ID: <4306244E.4060405@ucsd.edu> Adrian L. Garcia-Lomana wrote: > Should I code this myself somehow? There is anything specific for DAE on > SciPy? Any ideas/suggestions? Not yet, I don't believe. Some people have mentioned wanting to wrap DASPK, DASSL, and DASKR. google('site:scipy.net "DASSL in SciPy"') -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From zhiwen.chong at elf.mcgill.ca Fri Aug 19 15:15:28 2005 From: zhiwen.chong at elf.mcgill.ca (Zhiwen Chong) Date: Fri, 19 Aug 2005 15:15:28 -0400 Subject: [SciPy-user] DAE In-Reply-To: <35379.131.215.42.222.1124474791.squirrel@www.cds.caltech.edu> References: <35379.131.215.42.222.1124474791.squirrel@www.cds.caltech.edu> Message-ID: <54C0ACCF-667A-4FC5-9EEF-6D88CF9096D8@elf.mcgill.ca> On 19-Aug-05, at 2:06 PM, Adrian L. Garcia-Lomana wrote: > Should I code this myself somehow? There is anything specific for > DAE on > SciPy? Any ideas/suggestions? I was going to try to wrap DASSL using F2PY as a side project . My interest in DASSL was solely in its function as a reference algorithm for my unit tests. (I'm currently using Orthogonal Collocation on Finite Elements, i.e. implicit Runge-Kutta to do DAE integration.) I spent a weekend studying F2PY and DASSL, tweaking my pyf file, trying to get the wrapper to work, but alas, it wouldn't compile on my machine. Since then I haven't had the time or inclination to fiddle with it. (plus I don't need it for my research) If you want to have a go at it, take a look at this: http://moncs.cs.mcgill.ca/people/slacoste/research/report/ SummerReport.html#tth_sEc3 And this: http://cens.ioc.ee/projects/f2py2e/usersguide/index.html Let us know if you have any success. Zhiwen -- "If the women don't find you handsome, they should at least find you handy." - Red Green From rmuller at sandia.gov Fri Aug 19 15:20:45 2005 From: rmuller at sandia.gov (Rick Muller) Date: Fri, 19 Aug 2005 13:20:45 -0600 Subject: [SciPy-user] Pointers installing scipy on OS X In-Reply-To: <723eb693050819065225478618@mail.gmail.com> References: <2df1b59db0070306c99ca9c7925fc922@sandia.gov> <7BD868A2-48CF-4BBC-90F8-329D79289414@cwazy.co.uk> <723eb69305081820044eccd7bb@mail.gmail.com> <7864f53f0721bc001564ce36aa5ecc5b@sandia.gov> <723eb693050819065225478618@mail.gmail.com> Message-ID: <0af16dd586ecfdeb7b76402d341b2b60@sandia.gov> On Aug 19, 2005, at 7:52 AM, Chris Fonnesbeck wrote: > On 8/19/05, Rick Muller wrote: >> >> On Aug 18, 2005, at 9:04 PM, Chris Fonnesbeck wrote: >>> >>> Rick, could you provide the full output from your attempted build -- >>> that will help me diagnose the problem. >>> >> >> Attached. Thanks very much for looking. >> > > Rick, > > Try disabling xplt (you probably want to use gplt instead anyhow) by > adding it to the ignore_packages list as a string (at the end of the > setup.py file. Then try a clean build. > > Chris, Thanks for your help. This worked much better. I've attached the error messages I got after I compiled, installed, and ran scipy.test(). Are these anything I should be worried about? I'm primarily interested in the scipy.optimize routines. Rick >>> import scipy >>> scipy.test() !! No test file 'test_lena.py' found for !! No test file 'test_build_py.py' found for Found 4 tests for scipy.io.array_import Found 23 tests for scipy_base.function_base !! No test file 'test_ltisys.py' found for !! No test file 'test_info_integrate.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_vq.py' found for !! No test file 'test___init__.py' found for Found 128 tests for scipy.linalg.fblas !! No test file 'test_ccompiler.py' found for !! No test file 'test_info_interpolate.py' found for !! No test file 'test___cvs_version__.py' found for !! No test file 'test_info_cow.py' found for !! No test file 'test_spam.py' found for !! No test file 'test_quadpack.py' found for !! No test file 'test_info_gplt.py' found for !! No test file 'test_tree.py' found for Found 92 tests for scipy.stats.stats Found 36 tests for scipy.linalg.decomp !! No test file 'test_display_test.py' found for !! No test file 'test_config_compiler.py' found for !! No test file 'test_quadrature.py' found for !! No test file 'test___init__.py' found for Found 20 tests for scipy.fftpack.pseudo_diffs !! No test file 'test_sigtools.py' found for !! No test file 'test_optimize.py' found for !! No test file 'test_scipy_test_version.py' found for !! No test file 'test__iterative.py' found for !! No test file 'test_build_clib.py' found for !! No test file 'test_specfun.py' found for !! No test file 'test__compiled_base.py' found for !! No test file 'test_dumb_shelve.py' found for !! No test file 'test_common_routines.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_iterative.py' found for !! No test file 'test__fftpack.py' found for Found 5 tests for scipy.interpolate.fitpack !! No test file 'test_calc_lwork.py' found for !! No test file 'test_ode.py' found for !! No test file 'test___cvs_version__.py' found for !! No test file 'test_info_io.py' found for !! No test file 'test___init__.py' found for !! No test file 'test__zeros.py' found for !! No test file 'test_futil.py' found for !! No test file 'test___cvs_version__.py' found for Found 12 tests for scipy.io.mmio !! No test file 'test__flinalg.py' found for Found 2 tests for scipy_base.fastumath !! No test file 'test_linesearch.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_convolve.py' found for !! No test file 'test___init__.py' found for Found 4 tests for scipy.linalg.lapack !! No test file 'test_ga_list.py' found for !! No test file 'test_special_version.py' found for Found 19 tests for scipy.fftpack.basic !! No test file 'test_anneal.py' found for !! No test file 'test_fitpack2.py' found for !! No test file 'test_gene.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_info_plt.py' found for !! No test file 'test_numpyio.py' found for !! No test file 'test_extension.py' found for !! No test file 'test_data_store.py' found for !! No test file 'test_scipy_base_version.py' found for !! No test file 'test_install.py' found for !! No test file 'test_algorithm.py' found for Found 1 tests for scipy.optimize.zeros !! No test file 'test___init__.py' found for !! No test file 'test_cblas.py' found for !! No test file 'test_pyPlot.py' found for !! No test file 'test_info_cluster.py' found for !! No test file 'test_mio.py' found for !! No test file 'test_install_data.py' found for !! No test file 'test___init__.py' found for Found 4 tests for scipy_base.index_tricks !! No test file 'test_selection.py' found for !! No test file 'test_fftpack_version.py' found for !! No test file 'test_scaling.py' found for !! No test file 'test_bdist_rpm.py' found for Found 41 tests for scipy.linalg.basic !! No test file 'test_odepack.py' found for !! No test file 'test_exec_command.py' found for !! No test file 'test_common_routines.py' found for !! No test file 'test_interpolate.py' found for !! No test file 'test_wxplt.py' found for !! No test file 'test_lbfgsb.py' found for !! No test file 'test_language.py' found for Found 43 tests for scipy_base.shape_base !! No test file 'test_linalg_version.py' found for !! No test file 'test_interface.py' found for !! No test file 'test___init__.py' found for Found 9 tests for scipy_base.matrix_base !! No test file 'test_minpack2.py' found for !! No test file 'test_machar.py' found for !! No test file 'test_log.py' found for !! No test file 'test_info_scipy_base.py' found for Found 342 tests for scipy.special.basic !! No test file 'test_bsplines.py' found for !! No test file 'test_unixccompiler.py' found for !! No test file 'test__minpack.py' found for !! No test file 'test_clapack.py' found for !! No test file 'test_interface.py' found for !! No test file 'test_scimath.py' found for !! No test file 'test_new_plot.py' found for !! No test file 'test_moduleTNC.py' found for Found 6 tests for scipy.linalg.matfuncs !! No test file 'test___init__.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_vode.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_scipy_distutils_version.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_info_signal.py' found for !! No test file 'test_sync_cluster.py' found for !! No test file 'test__quadpack.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_testing.py' found for !! No test file 'test_scipy_version.py' found for !! No test file 'test_info_fftpack.py' found for !! No test file 'test_info_linalg.py' found for !! No test file 'test_build_src.py' found for !! No test file 'test__odepack.py' found for !! No test file 'test_build.py' found for !! No test file 'test_plot_objects.py' found for !! No test file 'test_flapack.py' found for !! No test file 'test_pexec.py' found for !! No test file 'test_tnc.py' found for !! No test file 'test_population.py' found for !! No test file 'test_cephes.py' found for !! No test file 'test_helpmod.py' found for !! No test file 'test__support.py' found for Found 39 tests for scipy_base.type_check Found 2 tests for scipy_base.limits !! No test file 'test_filter_design.py' found for Found 10 tests for scipy.stats.morestats !! No test file 'test_ga_util.py' found for !! No test file 'test_genome.py' found for !! No test file 'test_waveforms.py' found for !! No test file 'test_common_routines.py' found for !! No test file 'test_dist.py' found for !! No test file 'test___init__.py' found for Found 1 tests for scipy.optimize.cobyla !! No test file 'test_info_special.py' found for !! No test file 'test_flinalg.py' found for Found 14 tests for scipy.linalg.blas !! No test file 'test_from_template.py' found for !! No test file 'test_rv.py' found for !! No test file 'test_tree_opt.py' found for !! No test file 'test_minpack.py' found for !! No test file 'test_spline.py' found for !! No test file 'test___init__.py' found for Found 2 tests for scipy.xxx.foo !! No test file 'test_pilutil.py' found for !! No test file 'test__fitpack.py' found for !! No test file 'test__lbfgsb.py' found for !! No test file 'test_orthogonal.py' found for !! No test file 'test_dfitpack.py' found for !! No test file 'test_core.py' found for !! No test file 'test___init__.py' found for Found 70 tests for scipy.stats.distributions !! No test file 'test_rand.py' found for !! No test file 'test_info_stats.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_sdist.py' found for !! No test file 'test_statlib.py' found for !! No test file 'test_misc_util.py' found for !! No test file 'test_plot_utility.py' found for !! No test file 'test_info_xxx.py' found for !! No test file 'test_colormap.py' found for Found 4 tests for scipy.fftpack.helper !! No test file 'test_info_optimize.py' found for !! No test file 'test_pickler.py' found for !! No test file 'test_line_endings.py' found for !! No test file 'test_install_headers.py' found for !! No test file 'test_polynomial.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_ppimport.py' found for !! No test file 'test_cow.py' found for !! No test file 'test_build_ext.py' found for Found 3 tests for scipy.signal.signaltools !! No test file 'test__cobyla.py' found for Found 0 tests for __main__ Don't worry about a warning regarding the number of bytes read. Warning: 1000000 bytes requested, 20 bytes read. ..............................caxpy:n=4 ..caxpy:n=3 ....ccopy:n=4 ..ccopy:n=3 .............cscal:n=4 ....cswap:n=4 ..cswap:n=3 .....daxpy:n=4 ..daxpy:n=3 ....dcopy:n=4 ..dcopy:n=3 .............dscal:n=4 ....dswap:n=4 ..dswap:n=3 .....saxpy:n=4 ..saxpy:n=3 ....scopy:n=4 ..scopy:n=3 .............sscal:n=4 ....sswap:n=4 ..sswap:n=3 .....zaxpy:n=4 ..zaxpy:n=3 ....zcopy:n=4 ..zcopy:n=3 .............zscal:n=4 ....zswap:n=4 ..zswap:n=3 ........................................................................ ........................................................................ ....../System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/scipy/interpolate/fitpack2.py:412: UserWarning: The coefficients of the spline returned have been computed as the minimal norm least-squares solution of a (numerically) rank deficient system (deficiency=7). If deficiency is large, the results may be inaccurate. Deficiency may strongly depend on the value of eps. warnings.warn(message) ................E.... **************************************************************** WARNING: clapack module is empty ----------- See scipy/INSTALL.txt for troubleshooting. Notes: * If atlas library is not found by scipy/system_info.py, then scipy uses flapack instead of clapack. **************************************************************** .....................TESTING CONVERGENCE zero should be 1 function f2 cc.bisect : 1.0000000000001952 cc.ridder : 1.0000000000004661 cc.brenth : 0.9999999999999997 cc.brentq : 0.9999999999999577 function f3 cc.bisect : 1.0000000000001952 cc.ridder : 1.0000000000000000 cc.brenth : 1.0000000000000009 cc.brentq : 1.0000000000000011 function f4 cc.bisect : 1.0000000000001952 cc.ridder : 1.0000000000001454 cc.brenth : 0.9999999999993339 cc.brentq : 0.9999999999993339 function f5 cc.bisect : 1.0000000000001952 cc.ridder : 1.0000000000004574 cc.brenth : 0.9999999999991444 cc.brentq : 0.9999999999991444 function f6 cc.bisect : 1.0000000000001952 cc.ridder : 1.0000000000000637 cc.brenth : 0.9999999999999625 cc.brentq : 1.0000000000009841 ........................................................................ ........................................................................ ........................................................................ ........................................................................ .....................................Gegenbauer, a = 0.71904257061 ........................................................................ ...............shifted jacobi p,q = 2.33495352486 2.51752812768 ............................Result may be inaccurate, approximate err = 8.14759309194e-09 ...Result may be inaccurate, approximate err = 4.54747350886e-13 ..............................................Ties preclude use of exact statistic. ..Ties preclude use of exact statistic. ................Result: [ 4.95535778 0.6666553 ] (exact result = 4.955356249106168, 0.666666666666666) . **************************************************************** WARNING: cblas module is empty ----------- See scipy/INSTALL.txt for troubleshooting. Notes: * If atlas library is not found by scipy/system_info.py, then scipy uses fblas instead of cblas. **************************************************************** ................Testing alpha .Testing anglit .Testing arcsine ..Testing beta .Testing betaprime ..Testing bradford .Testing burr .Testing cauchy .Testing chi .Testing chi2 .Testing dgamma ..Testing dweibull .Testing erlang .Testing expon .Testing exponpow .Testing exponweib .Testing f .Testing fatiguelife .Testing fisk .Testing foldcauchy .Testing foldnorm .Testing frechet_l .Testing frechet_r .Testing gamma .Testing genextreme .Testing gengamma .Testing genhalflogistic .Testing genlogistic .Testing genpareto ..Testing gilbrat .Testing gompertz .Testing gumbel_l .Testing gumbel_r .Testing halfcauchy .Testing halflogistic .Testing halfnorm ..Testing hypsecant .Testing laplace .Testing loggamma .Testing logistic .Testing lognorm ..Testing lomax .Testing maxwell .Testing nakagami ..Testing ncf .Testing nct .Testing ncx2 .Testing norm .Testing pareto ..Testing powerlaw ....Testing rayleigh .Testing reciprocal .Testing t .Testing triang .Testing tukeylambda .Testing uniform .Testing weibull_max .Testing weibull_min ......... ====================================================================== ERROR: check_simple_todense (scipy.io.mmio.test_mmio.test_mmio_coordinate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/scipy/io/tests/test_mmio.py", line 152, in check_simple_todense b = mmread(fn).todense() AttributeError: todense ---------------------------------------------------------------------- Ran 946 tests in 12.924s FAILED (errors=1) >>> From alopez at cds.caltech.edu Fri Aug 19 16:47:38 2005 From: alopez at cds.caltech.edu (Adrian L. Garcia-Lomana) Date: Fri, 19 Aug 2005 13:47:38 -0700 (PDT) Subject: [SciPy-user] DAE In-Reply-To: <54C0ACCF-667A-4FC5-9EEF-6D88CF9096D8@elf.mcgill.ca> References: <35379.131.215.42.222.1124474791.squirrel@www.cds.caltech.edu> <54C0ACCF-667A-4FC5-9EEF-6D88CF9096D8@elf.mcgill.ca> Message-ID: <39419.131.215.42.222.1124484458.squirrel@www.cds.caltech.edu> Thanks for your suggestions, I think I have better idea now of the state of the art of this topic. I'm having a quick look to the links you pointed me. I need to spend some time to understand them. Unfortunately, making all this working properly seem too much for my programming skills. I'll let you know anyway if I get something useful. Thanks, Adri?n. > On 19-Aug-05, at 2:06 PM, Adrian L. Garcia-Lomana wrote: >> Should I code this myself somehow? There is anything specific for >> DAE on >> SciPy? Any ideas/suggestions? > > I was going to try to wrap DASSL using F2PY as a side project . My > interest in DASSL was solely in its function as a reference algorithm > for my unit tests. (I'm currently using Orthogonal Collocation on > Finite Elements, i.e. implicit Runge-Kutta to do DAE integration.) I > spent a weekend studying F2PY and DASSL, tweaking my pyf file, trying > to get the wrapper to work, but alas, it wouldn't compile on my > machine. Since then I haven't had the time or inclination to fiddle > with it. (plus I don't need it for my research) > > If you want to have a go at it, take a look at this: > http://moncs.cs.mcgill.ca/people/slacoste/research/report/ > SummerReport.html#tth_sEc3 > > And this: > http://cens.ioc.ee/projects/f2py2e/usersguide/index.html > > Let us know if you have any success. > > Zhiwen > -- > "If the women don't find you handsome, they should at least find you > handy." - Red Green > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From w.northcott at unsw.edu.au Fri Aug 19 17:16:00 2005 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Sat, 20 Aug 2005 07:16:00 +1000 Subject: [SciPy-user] Pointers installing scipy on OS X In-Reply-To: <20050819170708.EEEAB3EB68@www.scipy.com> References: <20050819170708.EEEAB3EB68@www.scipy.com> Message-ID: <3ECE8D8F-6440-4C51-8456-D52AA78C89CF@unsw.edu.au> On 20/08/2005, at 3:07 AM, scipy-user-request at scipy.net wrote: > blas_opt_info: > FOUND: > extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] > define_macros = [('NO_ATLAS_INFO', 3)] > extra_compile_args = ['-faltivec', '-framework', 'Accelerate'] > > lapack_opt_info: > FOUND: > extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] > define_macros = [('NO_ATLAS_INFO', 3)] > extra_compile_args = ['-faltivec', '-framework', 'Accelerate'] I know this is not relevant to the problem being discussed, but those few lines above don't look right. They may work, but that may be luck. AFAIK '-framework Accelerate' is not like '-Lfoodir -lfoo'. This first of these is a single linker option and should not be separated, the second is two options and can be separated as long as 'lfoo' follows '-Lfoodir'. It looks from the above that '-framework' and 'Accelerate' are being regarded as separate options. It will work if they happen to follow each other, but if something creeps in between the build will break. Of course neither of them are compile options like '-faltivec'. So I am not sure what they are doing in extra_compile_args. Bill Northcott From akumar at ee.iitm.ac.in Sun Aug 21 02:52:44 2005 From: akumar at ee.iitm.ac.in (Kumar Appaiah) Date: Sun, 21 Aug 2005 12:22:44 +0530 Subject: [SciPy-user] Solving "difference" equations Message-ID: <20050821065244.GA5388@localhost.localdomain> Dear Scipy users, I would like to know whether SciPy has a facility allowing one to solve discrete-time difference equations. For example, equations like the following: y[n] = y[n - 1] + x[n], n is an integer. I tried using odeint, but it solves it as a continuous time equation (or so I think...). Setting hmax to 1.0 also doesn't help. What is the right way? Thanks. Kumar -- Kumar Appaiah, 462, Jamuna Hostel, Indian Institute of Technology Madras, Chennai - 600 036 From rkern at ucsd.edu Sun Aug 21 02:49:55 2005 From: rkern at ucsd.edu (Robert Kern) Date: Sat, 20 Aug 2005 23:49:55 -0700 Subject: [SciPy-user] Solving "difference" equations In-Reply-To: <20050821065244.GA5388@localhost.localdomain> References: <20050821065244.GA5388@localhost.localdomain> Message-ID: <43082413.50300@ucsd.edu> Kumar Appaiah wrote: > Dear Scipy users, > I would like to know whether SciPy has a facility allowing one to > solve discrete-time difference equations. For example, equations like > the following: > > y[n] = y[n - 1] + x[n], n is an integer. > > I tried using odeint, but it solves it as a continuous time equation > (or so I think...). Setting hmax to 1.0 also doesn't help. > > What is the right way? Difference equations are rather trivial to do yourself via a for-loop. I don't think there are any special algorithms that need to be applied. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From ganesh_v at iitm.ac.in Sun Aug 21 05:17:15 2005 From: ganesh_v at iitm.ac.in (Ganesh V) Date: Sun, 21 Aug 2005 14:47:15 +0530 Subject: [SciPy-user] Compiler problem with Weave Message-ID: <20050821091715.GA4552@iitm.ac.in> Hi! I have a problem with Weave and I am not able to decipher what the problem is. A few of my friends too have the same problem. Have any of you encountered this problem? The commands that I gave in the python environ are as follows import scipy from Numeric import * a = arange(25) x = [] expr = "x=a*2" scipy.weave.blitz(expr) I am running Debian Sid. The error was too long. A lot of warninigs and may be some errors in the moddle. I have attached the last call trace back alone as a file. Bye! -- Ganesh V Undergraduate student, Aerospace Engineering, IIT Madras, Chennai-37. My homepage: http://www.ae.iitm.ac.in/~ae03b007 -------------- next part -------------- A non-text attachment was scrubbed... Name: weave-err.txt.bz2 Type: application/octet-stream Size: 1193 bytes Desc: not available URL: From akumar at ee.iitm.ac.in Sun Aug 21 06:26:50 2005 From: akumar at ee.iitm.ac.in (Kumar Appaiah) Date: Sun, 21 Aug 2005 15:56:50 +0530 Subject: [SciPy-user] Solving "difference" equations In-Reply-To: <43082413.50300@ucsd.edu> References: <20050821065244.GA5388@localhost.localdomain> <43082413.50300@ucsd.edu> Message-ID: <20050821102650.GB5583@localhost.localdomain> On Sat, Aug 20, 2005 at 11:49:55PM -0700, Robert Kern wrote: > > Difference equations are rather trivial to do yourself via a for-loop. I > don't think there are any special algorithms that need to be applied. Thanks. I just thought there might be some functions to be used for this purpose; not that they are necessary, as you have said. Kumar -- Kumar Appaiah, 462, Jamuna Hostel, Indian Institute of Technology Madras, Chennai - 600 036 From prabhu_r at users.sf.net Sun Aug 21 06:59:07 2005 From: prabhu_r at users.sf.net (Prabhu Ramachandran) Date: Sun, 21 Aug 2005 16:29:07 +0530 Subject: [SciPy-user] Compiler problem with Weave In-Reply-To: <20050821091715.GA4552@iitm.ac.in> References: <20050821091715.GA4552@iitm.ac.in> Message-ID: <17160.24187.48441.523763@monster.linux.in> >>>>> "Ganesh" == Ganesh V writes: Ganesh> import scipy Ganesh> from Numeric import * Ganesh> a = arange(25) Ganesh> x = [] Replace "x = []" with "x = zeros(25)" or if you have a recent enough Numeric "x = empty(25)" and this should work. cheers, prabhu From ganesh_v at iitm.ac.in Sun Aug 21 07:44:43 2005 From: ganesh_v at iitm.ac.in (Ganesh V) Date: Sun, 21 Aug 2005 17:14:43 +0530 Subject: [SciPy-user] Compiler problem with Weave In-Reply-To: <17160.24187.48441.523763@monster.linux.in> References: <20050821091715.GA4552@iitm.ac.in> <17160.24187.48441.523763@monster.linux.in> Message-ID: <20050821114443.GA5600@iitm.ac.in> Hi! On Sun, Aug 21, 2005 at 04:29:07PM +0530, Prabhu Ramachandran wrote: > Ganesh> import scipy > Ganesh> from Numeric import * > Ganesh> a = arange(25) > Ganesh> x = [] > > Replace "x = []" with "x = zeros(25)" or if you have a recent enough > Numeric "x = empty(25)" and this should work. "x=empty(25)" worked, but Weave DID NOT. The same problems again. I found that even "inline" doesn't work. It works for ordinary printf statements and other small stuff fine. But not for Numeric arrays that I used. The error of inline also looked similar to the error that I got with "weave.blitz". Is it a problem with the conversion of datatype that is being passed in? On the Website it was put up that weave has been tested only with gcc 2.95. Mine is gcc4. Can that be a problem? -- Ganesh V Undergraduate student, Aerospace Engineering, IIT Madras, Chennai-37. My homepage: http://www.ae.iitm.ac.in/~ae03b007 From rkern at ucsd.edu Sun Aug 21 07:49:44 2005 From: rkern at ucsd.edu (Robert Kern) Date: Sun, 21 Aug 2005 04:49:44 -0700 Subject: [SciPy-user] Compiler problem with Weave In-Reply-To: <20050821114443.GA5600@iitm.ac.in> References: <20050821091715.GA4552@iitm.ac.in> <17160.24187.48441.523763@monster.linux.in> <20050821114443.GA5600@iitm.ac.in> Message-ID: <43086A58.3090801@ucsd.edu> Ganesh V wrote: > "x=empty(25)" worked, but Weave DID NOT. The same problems again. I > found that even "inline" doesn't work. It works for ordinary printf > statements and other small stuff fine. But not for Numeric arrays > that I used. The error of inline also looked similar to the error > that I got with "weave.blitz". Is it a problem with the conversion > of datatype that is being passed in? > > On the Website it was put up that weave has been tested only with > gcc 2.95. Mine is gcc4. Can that be a problem? Probably. gcc 4.0 fails to compile quite a lot of C++ code that gcc 3.x accepts. With the latest CVS of scipy, Python 2.4.1, gcc 3.3 on OS X: In [1]: a = arange(25) In [2]: x = empty(25) In [3]: expr = "x = a*2" In [4]: weave.blitz(expr) In [5]: x Out[5]: array([ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48]) -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From rkern at ucsd.edu Sun Aug 21 08:09:57 2005 From: rkern at ucsd.edu (Robert Kern) Date: Sun, 21 Aug 2005 05:09:57 -0700 Subject: [SciPy-user] Compiler problem with Weave In-Reply-To: <20050821114443.GA5600@iitm.ac.in> References: <20050821091715.GA4552@iitm.ac.in> <17160.24187.48441.523763@monster.linux.in> <20050821114443.GA5600@iitm.ac.in> Message-ID: <43086F15.4020703@ucsd.edu> Ganesh V wrote: > On the Website it was put up that weave has been tested only with > gcc 2.95. Mine is gcc4. Can that be a problem? Checking with gcc 4.0 indeed confirms that gcc 4.0 doesn't like the old blitz headers that we use. We should try to upgrade, but my initial attempt to use the latest blitz (0.6) hasn't worked, yet. I'm sure I'm screwing something up, though. Using the old headers and gcc 4.0: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy_complete-0.3.3_309.4626-py2.4-darwin-8.1.0-Power_Macintosh.egg/weave/blitz-20001213/blitz/mathfunc.h: In static member function `static int blitz::_bz_blitz_isnan::apply(P_numtype1)': /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy_complete-0.3.3_309.4626-py2.4-darwin-8.1.0-Power_Macintosh.egg/weave/blitz-20001213/blitz/mathfunc.h:1351: error: ?::isnan? has not been declared [etc. -- Useful tip: when GCC spits out pages and pages of error messages, the important error is usually at the very top, and you can ignore everything that follows.] -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From rkern at ucsd.edu Sun Aug 21 08:23:21 2005 From: rkern at ucsd.edu (Robert Kern) Date: Sun, 21 Aug 2005 05:23:21 -0700 Subject: [SciPy-user] Compiler problem with Weave In-Reply-To: <43086F15.4020703@ucsd.edu> References: <20050821091715.GA4552@iitm.ac.in> <17160.24187.48441.523763@monster.linux.in> <20050821114443.GA5600@iitm.ac.in> <43086F15.4020703@ucsd.edu> Message-ID: <43087239.7020309@ucsd.edu> Robert Kern wrote: > Ganesh V wrote: > >> On the Website it was put up that weave has been tested only with >> gcc 2.95. Mine is gcc4. Can that be a problem? > > Checking with gcc 4.0 indeed confirms that gcc 4.0 doesn't like the old > blitz headers that we use. We should try to upgrade, but my initial > attempt to use the latest blitz (0.6) hasn't worked, yet. I'm sure I'm > screwing something up, though. And I was. Using the *actual* latest blitz (0.8), ./configure'ing it, copying over the blitz/ subdirectory as weave/blitz-20001213/blitz/, and editing the configuration a bit to handle the ::isnan problem, does in fact work with gcc 4.0. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From ganesh_v at iitm.ac.in Sun Aug 21 08:35:58 2005 From: ganesh_v at iitm.ac.in (Ganesh V) Date: Sun, 21 Aug 2005 18:05:58 +0530 Subject: [SciPy-user] Compiler problem with Weave In-Reply-To: <17160.24187.48441.523763@monster.linux.in> References: <20050821091715.GA4552@iitm.ac.in> <17160.24187.48441.523763@monster.linux.in> Message-ID: <20050821123558.GA5754@iitm.ac.in> Hi! This time I've attached the output of the laplace.py module that Prachu Ramachandran has written for comparing the performance of various tools in weave in http://scipy.org/documentation/weave/weaveperformance.html I just did "python laplace.py" I guess it's the same output, but with all it's ugliness. Bye! -- Ganesh V Undergraduate student, Aerospace Engineering, IIT Madras, Chennai-37. My homepage: http://www.ae.iitm.ac.in/~ae03b007 -------------- next part -------------- A non-text attachment was scrubbed... Name: weaveerror.txt.bz2 Type: application/octet-stream Size: 2730 bytes Desc: not available URL: From oliphant at ee.byu.edu Sun Aug 21 16:02:43 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Sun, 21 Aug 2005 14:02:43 -0600 Subject: [SciPy-user] Solving "difference" equations In-Reply-To: <43082413.50300@ucsd.edu> References: <20050821065244.GA5388@localhost.localdomain> <43082413.50300@ucsd.edu> Message-ID: <4308DDE3.4010601@ee.byu.edu> Robert Kern wrote: >Kumar Appaiah wrote: > > >>Dear Scipy users, >>I would like to know whether SciPy has a facility allowing one to >>solve discrete-time difference equations. For example, equations like >>the following: >> >>y[n] = y[n - 1] + x[n], n is an integer. >> >>I tried using odeint, but it solves it as a continuous time equation >>(or so I think...). Setting hmax to 1.0 also doesn't help. >> >>What is the right way? >> >> > >Difference equations are rather trivial to do yourself via a for-loop. I >don't think there are any special algorithms that need to be applied. > > > Robert is right, but there are some filtering tools that may be useful because they do the loop in C. The tools are in scipy.signal called lfilter (linear filter). info(scipy.signal.lfilter) lfilter(b, a, x, axis=-1, zi=None) Filter data along one-dimension with an IIR or FIR filter. Description Filter a data sequence, x, using a digital filter. This works for many fundamental data types (including Object type). The filter is a direct form II transposed implementation of the standard difference equation (see "Algorithm"). Inputs: b -- The numerator coefficient vector in a 1-D sequence. a -- The denominator coefficient vector in a 1-D sequence. If a[0] is not 1, then both a and b are normalized by a[0]. x -- An N-dimensional input array. axis -- The axis of the input data array along which to apply the linear filter. The filter is applied to each subarray along this axis (*Default* = -1) zi -- Initial conditions for the filter delays. It is a vector (or array of vectors for an N-dimensional input) of length max(len(a),len(b)). If zi=None or is not given then initial rest is assumed. SEE signal.lfiltic for more information. Outputs: (y, {zf}) y -- The output of the digital filter. zf -- If zi is None, this is not returned, otherwise, zf holds the final filter delay values. Algorithm: The filter function is implemented as a direct II transposed structure. This means that the filter implements y[n] = b[0]*x[n] + b[1]*x[n-1] + ... + b[nb]*x[n-nb] - a[1]*y[n-1] + ... + a[na]*y[n-na] using the following difference equations: y[m] = b[0]*x[m] + z[0,m-1] z[0,m] = b[1]*x[m] + z[1,m-1] - a[1]*y[m] ... z[n-3,m] = b[n-2]*x[m] + z[n-2,m-1] - a[n-2]*y[m] z[n-2,m] = b[n-1]*x[m] - a[n-1]*y[m] where m is the output sample number and n=max(len(a),len(b)) is the model order. The rational transfer function describing this filter in the z-transform domain is -1 -nb b[0] + b[1]z + ... + b[nb] z Y(z) = ---------------------------------- X(z) -1 -na a[0] + a[1]z + ... + a[na] z Also, to change the initial conditions you may find signal.lfiltic helpful info(scipy.signal.lfiltic) lfiltic(b, a, y, x=None) Given a linear filter (b,a) and initial conditions on the output y and the input x, return the inital conditions on the state vector zi which is used by lfilter to generate the output given the input. If M=len(b)-1 and N=len(a)-1. Then, the initial conditions are given in the vectors x and y as x = {x[-1],x[-2],...,x[-M]} y = {y[-1],y[-2],...,y[-N]} If x is not given, its inital conditions are assumed zero. If either vector is too short, then zeros are added to achieve the proper length. The output vector zi contains zi = {z_0[-1], z_1[-1], ..., z_K-1[-1]} where K=max(M,N). -Travis O. From erickt at dslextreme.com Sun Aug 21 16:17:50 2005 From: erickt at dslextreme.com (Erick Tryzelaar) Date: Sun, 21 Aug 2005 13:17:50 -0700 Subject: [SciPy-user] eta on a new release? Message-ID: <4308E16E.4080302@dslextreme.com> Hello, I'm maintaining a scipy package for the OS X project darwinports. I'm in the process of getting scipy to run on tiger, but rather than trying to get 0.3.2 to compile using gfortran, I'd prefer to use something a little more recent, since much of this has already been done in scipy's trunk. Are there any plans on releasing a new version that I could use? Thanks, -e From emsellem at obs.univ-lyon1.fr Tue Aug 23 02:25:35 2005 From: emsellem at obs.univ-lyon1.fr (Eric Emsellem) Date: Tue, 23 Aug 2005 08:25:35 +0200 Subject: [SciPy-user] list of routines and Documented functions in scipy? Message-ID: <430AC15F.1060902@obs.univ-lyon1.fr> Hi, I am using Scipy rather frequently now, but each time I need a new function, there seems to be no easy way to first know if there is something for me in scipy, and if yes, if it does really what I wish it to do. Example: I needed to perform a Kolmogorov-Smirnov test on 2 samples, and indeed after some keywords search on the web (Kolmogorov ,Smirnov, python) I found "ks_sample" in scipy.stats. This was relatively easy because the routine name is rather clear... But again, the help is short (not that critical for such a standard routine, but ... for more complex ones?). And then, I don't know if this is really the only routine I could use (maybe I could make use of other statistical tests if they are implemented? ), and if not which is the best. So my (nagging) question is: - is there a list somewhere of all useful routine in Scipy which are available and work, with some minimum documentation which would allow me to quickly find if something exists or not, and what it does. I know there is the scipy/tutorial.pdf document, but it is far from complete to say the least and it is meant I think as a tutorial, not as an exhaustive list of routines with their functioning. I realize that documenting all this is a lot of work, and I am not complaining about the "apparent" lack of docs there! I still have the impression (and I could be plain wrong) that there are not that many/frequent updates of the packages (although bugs have been reported and probably installed on CVS), and that documentation is rather lacking for such a nice set of routines. Sorry if I seem to play the bad guy there. Just asking...! (if these lists/docs don't exist, is there a plan for having one?) Thanks in advance! Eric From ganesh_v at iitm.ac.in Tue Aug 23 05:43:15 2005 From: ganesh_v at iitm.ac.in (Ganesh V) Date: Tue, 23 Aug 2005 15:13:15 +0530 Subject: [SciPy-user] Compiler problem with Weave In-Reply-To: <43086A58.3090801@ucsd.edu> References: <20050821091715.GA4552@iitm.ac.in> <17160.24187.48441.523763@monster.linux.in> <20050821114443.GA5600@iitm.ac.in> <43086A58.3090801@ucsd.edu> Message-ID: <20050823094315.GA7370@iitm.ac.in> Hi! I downgraded to gcc-3.3 and g++-3.3. It worked. So the problem was indeed with my gcc. Thanks for all the info. Bye! -- Ganesh V Undergraduate student, Aerospace Engineering, IIT Madras, Chennai-37. My homepage: http://www.ae.iitm.ac.in/~ae03b007 From aisaac at american.edu Tue Aug 23 09:03:43 2005 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 23 Aug 2005 09:03:43 -0400 Subject: [SciPy-user] list of routines and Documented functions in scipy? In-Reply-To: <430AC15F.1060902@obs.univ-lyon1.fr> References: <430AC15F.1060902@obs.univ-lyon1.fr> Message-ID: On Tue, 23 Aug 2005, Eric Emsellem apparently wrote: > So my (nagging) question is: > - is there a list somewhere of all useful routine in Scipy which are > available and work, with some minimum documentation which would allow me > to quickly find if something exists or not, and what it does. Just making sure you know about http://www.scipy.org/documentation/apidocs/scipy/ Cheers, Alan Isaac From yaroslavvb at gmail.com Tue Aug 23 21:35:09 2005 From: yaroslavvb at gmail.com (Yaroslav Bulatov) Date: Tue, 23 Aug 2005 18:35:09 -0700 Subject: [SciPy-user] scipy can't find Numeric header files during install Message-ID: I'm trying to install scipy with --prefix=~/usr option I've installed Numeric and headers went to " ~/usr/include/python2.3/Numeric/" But now when I install SciPy by doing "python setup.py install --prefix=~/usr", it says Lib/cluster/src/vq_wrap.cpp:563:33: Numeric/arrayobject.h: No such file or directory How can I tell it to look in "~/usr/include/python2.3/Numeric/" for Numeric headers? -- Yaroslav Bulatov bulatov at cs.oregonstate.edu Dearborn 102 Oregon State University Corvallis, OR From oliphant at ee.byu.edu Wed Aug 24 00:19:11 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 23 Aug 2005 22:19:11 -0600 Subject: [SciPy-user] scipy can't find Numeric header files during install In-Reply-To: References: Message-ID: <430BF53F.3080209@ee.byu.edu> Yaroslav Bulatov wrote: >I'm trying to install scipy with --prefix=~/usr option > >I've installed Numeric and headers went to " ~/usr/include/python2.3/Numeric/" >But now when I install SciPy by doing "python setup.py install >--prefix=~/usr", it says > >Lib/cluster/src/vq_wrap.cpp:563:33: Numeric/arrayobject.h: No such >file or directory > >How can I tell it to look in "~/usr/include/python2.3/Numeric/" for >Numeric headers? > > > Good question. I'm not sure exactly how the include directories are found. You may need to install Numeric first with the same prefix (do you have a python installation with that prefix?) But, you could try some things. Doing... python setup.py --help config I got the message Global options: --verbose (-v) run verbosely (default) --quiet (-q) run quietly (turns verbosity off) --dry-run (-n) don't actually do anything --help (-h) show detailed help message Options for 'config' command: --compiler specify the compiler type --cc specify the compiler executable --include-dirs (-I) list of directories to search for header files --define (-D) C preprocessor macros to define --undef (-U) C preprocessor macros to undefine --libraries (-l) external C libraries to link with --library-dirs (-L) directories to search for external C libraries --noisy show every action (compile, link, run, ...) taken --dump-source dump generated source files before attempting to compile them --fcompiler specify the Fortran compiler type usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help So, I suspect that python setup.py --prefix=~/usr config --include-dirs /usr/include/python2.3 install might work. You might have to run the build command first and then the install command. Good luck, -Travis From pau.gargallo at gmail.com Wed Aug 24 07:36:51 2005 From: pau.gargallo at gmail.com (Pau Gargallo) Date: Wed, 24 Aug 2005 13:36:51 +0200 Subject: [SciPy-user] interp2d ? Message-ID: <6ef8f3380508240436634cff5f@mail.gmail.com> Hi, i'm looking for functions (like interp2 in octave) for interpolating arrays. For example for transforming an image from Cartesian to polar coordinates. The function interp2d in scipy/interpolate/interpolate.py is unfinished and last changes had been done 2 years ago :_( Also, the tutorial.pdf talks about the function interpolate.linear_1d which i can not find. can someone help me? should i program these functions myself? would my code be welcome? tanks for everything you are doing! pau From stefan at sun.ac.za Wed Aug 24 07:39:46 2005 From: stefan at sun.ac.za (Stefan van der Walt) Date: Wed, 24 Aug 2005 13:39:46 +0200 Subject: [SciPy-user] problem using interp2d Message-ID: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> Hi, I am trying to use scipy.interpolate.interpolate.interp2d (why the double interpolate?) like this: ---- from scipy.interpolate.interpolate import interp2d from Numeric import * z = repeat([arange(3.0)], 3) i = interp2d(arange(3), arange(3), z, kind='linear') print i(0.5, 0.5) ---- I see the following error message Traceback (most recent call last): File "interp.py", line 8, in ? print i(0.5, 0.5) File "/usr/lib/python2.3/site-packages/scipy/interpolate/interpolate.py", line 79, in __call__ z,ier=fitpack._fitpack._bispev(*(self.tck+[x,y,dx,dy])) AttributeError: interp2d instance has no attribute 'tck' Has anyone else seen this behaviour? Can someone please check whether it is fixed in the latest SVN version (I am using scipy version 0.3.2 as packaged by Debian). Thanks St?fan From pau.gargallo at gmail.com Wed Aug 24 07:55:31 2005 From: pau.gargallo at gmail.com (Pau Gargallo) Date: Wed, 24 Aug 2005 13:55:31 +0200 Subject: [SciPy-user] problem using interp2d In-Reply-To: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> Message-ID: <6ef8f33805082404556ca3ce38@mail.gmail.com> i'm having exactly the same problem and i posted the same question 2 minutes before reciving your message (sometimes the world surprise me). interp2d seems to be unfinished and last edited 2 years ago. pau On 8/24/05, Stefan van der Walt wrote: > Hi, > > I am trying to use scipy.interpolate.interpolate.interp2d (why the > double interpolate?) like this: > > ---- > from scipy.interpolate.interpolate import interp2d > from Numeric import * > > z = repeat([arange(3.0)], 3) > > i = interp2d(arange(3), arange(3), z, kind='linear') > > print i(0.5, 0.5) > ---- > > I see the following error message > > Traceback (most recent call last): > File "interp.py", line 8, in ? > print i(0.5, 0.5) > File "/usr/lib/python2.3/site-packages/scipy/interpolate/interpolate.py", line 79, in __call__ > z,ier=fitpack._fitpack._bispev(*(self.tck+[x,y,dx,dy])) > AttributeError: interp2d instance has no attribute 'tck' > > > Has anyone else seen this behaviour? Can someone please check whether > it is fixed in the latest SVN version (I am using scipy version 0.3.2 > as packaged by Debian). > > Thanks > St?fan > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From d.howey at imperial.ac.uk Wed Aug 24 09:47:04 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Wed, 24 Aug 2005 14:47:04 +0100 Subject: [SciPy-user] Ipython "run" Message-ID: <056D32E9B2D93B49B01256A88B3EB218766EBB@icex2.ic.ac.uk> >Not really: what you describe is pretty much what I always do. Many of my 'top-level' scripts which use modules >I'm in the middle of modifying, look like: >import foo >reload(foo) >foo.dostuff() Thanks for this. What about when you're using 'from foo import *' to get things into the same namespace? Then reload doesn't seem to work.. I know it's a general python question.. Will have a dig into 'Learning Python' for an answer when I get home! Dave From ryanfedora at comcast.net Wed Aug 24 09:55:04 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Wed, 24 Aug 2005 09:55:04 -0400 Subject: [SciPy-user] Ipython "run" In-Reply-To: <056D32E9B2D93B49B01256A88B3EB218766EBB@icex2.ic.ac.uk> References: <056D32E9B2D93B49B01256A88B3EB218766EBB@icex2.ic.ac.uk> Message-ID: <430C7C38.9050801@comcast.net> I think this will work: import foo reload(foo) from foo import * Otherwise you may need to avoid the from foo import * during module development. Ryan Howey, David A wrote: >>Not really: what you describe is pretty much what I always do. Many of > > my 'top-level' scripts which use modules >I'm in the middle of > modifying, look like: > > >>import foo >>reload(foo) >>foo.dostuff() > > > Thanks for this. What about when you're using 'from foo import *' to get > things into the same namespace? Then reload doesn't seem to work.. I > know it's a general python question.. Will have a dig into 'Learning > Python' for an answer when I get home! > > Dave > > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From Fernando.Perez at colorado.edu Wed Aug 24 12:48:16 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Wed, 24 Aug 2005 10:48:16 -0600 Subject: [SciPy-user] Ipython "run" In-Reply-To: <430C7C38.9050801@comcast.net> References: <056D32E9B2D93B49B01256A88B3EB218766EBB@icex2.ic.ac.uk> <430C7C38.9050801@comcast.net> Message-ID: <430CA4D0.10508@colorado.edu> Ryan Krauss wrote: > I think this will work: > import foo > reload(foo) > from foo import * > > Otherwise you may need to avoid the from foo import * during module > development. I second that last suggestion as well. I just avoid 'import *' like the plague, and rather use (for very heavily used modules) shorthands: import Numeric as N N.foo N.bar... The 'import *' is IMHO only justified interactively: not only does it cause trouble with name clashes and reload(), but it also makes an often useful local optimization tricky: def func(): # we're about to do a long loop using some routine from N, so we make # it local, which is a faster lookup in python: foo = N.foo for i in range(BIG): foo(bar) If you did 'from Numeric import *', you have to do a local change of name, since 'foo=foo' is not valid: In [2]: f() --------------------------------------------------------------------------- exceptions.UnboundLocalError Traceback (most recent call last) /home/fperez/test/ /home/fperez/test/nsp.py in f() 1 from Numeric import * 2 3 def f(): ----> 4 array = array 5 return array([1,2,3]) UnboundLocalError: local variable 'array' referenced before assignment Cheers, f From d.howey at imperial.ac.uk Wed Aug 24 13:34:21 2005 From: d.howey at imperial.ac.uk (Howey, David A) Date: Wed, 24 Aug 2005 18:34:21 +0100 Subject: [SciPy-user] Ipython "run" Message-ID: <056D32E9B2D93B49B01256A88B3EB21835E742@icex2.ic.ac.uk> thanks for the tips. 'Learning Python' (from O'Rielly - the daddy!) agrees... :-) 'from' and 'reload' don't play together, apparantly. I'd better go and modify some code... Dave -----Original Message----- From: scipy-user-bounces at scipy.net on behalf of Fernando Perez Sent: Wed 24/08/2005 17:48 To: SciPy Users List Subject: Re: [SciPy-user] Ipython "run" Ryan Krauss wrote: > I think this will work: > import foo > reload(foo) > from foo import * > > Otherwise you may need to avoid the from foo import * during module > development. I second that last suggestion as well. I just avoid 'import *' like the plague, and rather use (for very heavily used modules) shorthands: import Numeric as N N.foo N.bar... The 'import *' is IMHO only justified interactively: not only does it cause trouble with name clashes and reload(), but it also makes an often useful local optimization tricky: def func(): # we're about to do a long loop using some routine from N, so we make # it local, which is a faster lookup in python: foo = N.foo for i in range(BIG): foo(bar) If you did 'from Numeric import *', you have to do a local change of name, since 'foo=foo' is not valid: In [2]: f() --------------------------------------------------------------------------- exceptions.UnboundLocalError Traceback (most recent call last) /home/fperez/test/ /home/fperez/test/nsp.py in f() 1 from Numeric import * 2 3 def f(): ----> 4 array = array 5 return array([1,2,3]) UnboundLocalError: local variable 'array' referenced before assignment Cheers, f _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3403 bytes Desc: not available URL: From oliphant at ee.byu.edu Wed Aug 24 14:51:48 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Wed, 24 Aug 2005 12:51:48 -0600 Subject: [SciPy-user] interp2d ? In-Reply-To: <6ef8f3380508240436634cff5f@mail.gmail.com> References: <6ef8f3380508240436634cff5f@mail.gmail.com> Message-ID: <430CC1C4.6040506@ee.byu.edu> Pau Gargallo wrote: >Hi, > >i'm looking for functions (like interp2 in octave) for interpolating >arrays. For example for transforming an image from Cartesian to polar >coordinates. > > >The function interp2d in scipy/interpolate/interpolate.py is >unfinished and last changes had been done 2 years ago :_( > >Also, the tutorial.pdf talks about the function interpolate.linear_1d >which i can not find. > >can someone help me? >should i program these functions myself > > >would my code be welcome? > > > Interpolation is in need of an overhaul. A good interp2d would be very welcome. You can acomplish some of it using the B-spline module in signal and the wrapped parts of fitpack. But, as far as I know the wrapped parts of fitpack aren't suitable for large 2-d interpolation approaches. I would like to see the interpolation module greatly enhanced, but as you can see, we are in need of willing developers. Absolutely your code would be welcome. -Travis O. From europa100 at comcast.net Wed Aug 24 15:06:58 2005 From: europa100 at comcast.net (europa100 at comcast.net) Date: Wed, 24 Aug 2005 19:06:58 +0000 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices Message-ID: <082420051906.10253.430CC551000DDF190000280D2205884484CFCFCE0E9F019D9A0A@comcast.net> Hi Travis! (and the list :) I don't know if you remember me. I am the creator of the Numeric Python EM Project, which is now on the scipy wiki. I ditched Verio, even though they had top notch FreeBSD service, quite a while ago, then was reinterested in the whole concept as of late and put my site back up under my Comcast acct. So now I am trying to find a more nerdy, geeky, glamourous domain, hahaha. I am trying to find a replacement (or fix) for Animabob, the 3d OpenGL viewer. With a simple color map and matrix dump, you get the beautiful pictures with FDTD. Unfortunately (this is a strange statement), now that my laptop (and probably everyone elses) runs a 3.5Ghz P4 and some hellatiosly fast graphics card, Animabob goes so fast that it is unuseable. I would like to replace Animabob with a scipy based viewer. But I have been out of the Python world for 3 or 4 years, so I have no idea how things have progressed and what is REALLY available. (and I have to update my links) Any help or direction would be really appreciated. Sincerely, Rob N3FT > Pau Gargallo wrote: > > >Hi, > > > >i'm looking for functions (like interp2 in octave) for interpolating > >arrays. For example for transforming an image from Cartesian to polar > >coordinates. > > > > > > >The function interp2d in scipy/interpolate/interpolate.py is > >unfinished and last changes had been done 2 years ago :_( > > > >Also, the tutorial.pdf talks about the function interpolate.linear_1d > >which i can not find. > > > >can someone help me? > >should i program these functions myself > > > > > >would my code be welcome? > > > > > > > > Interpolation is in need of an overhaul. A good interp2d would be > very welcome. You can acomplish some of it using the B-spline module in > signal and the wrapped parts of fitpack. But, as far as I know the > wrapped parts of fitpack aren't suitable for large 2-d interpolation > approaches. > > I would like to see the interpolation module greatly enhanced, but as > you can see, we are in need of willing developers. > > Absolutely your code would be welcome. > > -Travis O. > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From aisaac at american.edu Wed Aug 24 15:31:23 2005 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 24 Aug 2005 15:31:23 -0400 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices In-Reply-To: <082420051906.10253.430CC551000DDF190000280D2205884484CFCFCE0E9F019D9A0A@comcast.net> References: <082420051906.10253.430CC551000DDF190000280D2205884484CFCFCE0E9F019D9A0A@comcast.net> Message-ID: On Wed, 24 Aug 2005, europa100 at comcast.net apparently wrote: > I would like to replace Animabob with a scipy based viewer. Heard talk of ftp://ftp.ffi.no/spub/stsk/viz/index.html http://mayavi.sourceforge.net/ fwiw, Alan Isaac From ryanfedora at comcast.net Wed Aug 24 17:56:40 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Wed, 24 Aug 2005 17:56:40 -0400 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices In-Reply-To: References: <082420051906.10253.430CC551000DDF190000280D2205884484CFCFCE0E9F019D9A0A@comcast.net> Message-ID: <430CED18.6010309@comcast.net> mayavi is actively maintained. I have used it with some success. There was a bit of a learning curve for me to get the data in the right format and figure out how to display it. I think there is a lot of functionality, but that can make it harder to learn how to do simple things. Ryan Alan G Isaac wrote: > On Wed, 24 Aug 2005, europa100 at comcast.net apparently wrote: > >>I would like to replace Animabob with a scipy based viewer. > > > Heard talk of > ftp://ftp.ffi.no/spub/stsk/viz/index.html > http://mayavi.sourceforge.net/ > > fwiw, > Alan Isaac > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From europa100 at comcast.net Wed Aug 24 19:49:43 2005 From: europa100 at comcast.net (europa100 at comcast.net) Date: Wed, 24 Aug 2005 23:49:43 +0000 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices Message-ID: <082420052349.16628.430D0797000D1FE1000040F42205886360CFCFCE0E9F019D9A0A@comcast.net> I remember when Maya was just a simple child. I searched on Google and got a giant sensory overload from the hits. So now I am registered with the Alias community, so I am totally overloaded with this stuff. What the hell do I have to do to get some vis program for windoze? I have two laptops: an ultraexpensive Dell with OpenBSD on it (hail Theo!) which is at home and this HP zd8000 which is like a heater for my hotel room, with Windoze XP-Pro on it, Python, SciPy, Numeric, etc etc oh, and lots of FDTD programs that run on Numeric and then dump out the 3d matrix, per my web site: http://home.comcast.net/~europa100/ I will do the "RTFM" approach but advice is always appreciated here Rob. > mayavi is actively maintained. I have used it with some success. There > was a bit of a learning curve for me to get the data in the right format > and figure out how to display it. I think there is a lot of > functionality, but that can make it harder to learn how to do simple things. > > Ryan > > Alan G Isaac wrote: > > On Wed, 24 Aug 2005, europa100 at comcast.net apparently wrote: > > > >>I would like to replace Animabob with a scipy based viewer. > > > > > > Heard talk of > > ftp://ftp.ffi.no/spub/stsk/viz/index.html > > http://mayavi.sourceforge.net/ > > > > fwiw, > > Alan Isaac > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user > > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From europa100 at comcast.net Wed Aug 24 20:02:29 2005 From: europa100 at comcast.net (europa100 at comcast.net) Date: Thu, 25 Aug 2005 00:02:29 +0000 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices Message-ID: <082520050002.6866.430D0A950000327700001AD22205886360CFCFCE0E9F019D9A0A@comcast.net> Ok, I get it. There is Maya and there is MayaVi. I got the MayaVi. What relationship is there between these two programs or whatever. I kind of got lost. Gee, I've been out of this for too long. Rob. > I remember when Maya was just a simple child. I searched on Google and got a > giant sensory overload from the hits. So now I am registered with the Alias > community, so I am totally overloaded with this stuff. > > What the hell do I have to do to get some vis program for windoze? I have two > laptops: an ultraexpensive Dell with OpenBSD on it (hail Theo!) which is at home > and this HP zd8000 which is like a heater for my hotel room, with Windoze > XP-Pro on it, Python, SciPy, Numeric, etc etc oh, and lots of FDTD programs that > run on Numeric and then dump out the 3d matrix, per my web site: > > http://home.comcast.net/~europa100/ > > I will do the "RTFM" approach but advice is always appreciated here > > Rob. > > > > > mayavi is actively maintained. I have used it with some success. There > > was a bit of a learning curve for me to get the data in the right format > > and figure out how to display it. I think there is a lot of > > functionality, but that can make it harder to learn how to do simple things. > > > > Ryan > > > > Alan G Isaac wrote: > > > On Wed, 24 Aug 2005, europa100 at comcast.net apparently wrote: > > > > > >>I would like to replace Animabob with a scipy based viewer. > > > > > > > > > Heard talk of > > > ftp://ftp.ffi.no/spub/stsk/viz/index.html > > > http://mayavi.sourceforge.net/ > > > > > > fwiw, > > > Alan Isaac > > > > > > _______________________________________________ > > > SciPy-user mailing list > > > SciPy-user at scipy.net > > > http://www.scipy.net/mailman/listinfo/scipy-user > > > > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From aisaac at american.edu Wed Aug 24 21:18:31 2005 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 24 Aug 2005 21:18:31 -0400 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices In-Reply-To: <082520050002.6866.430D0A950000327700001AD22205886360CFCFCE0E9F019D9A0A@comcast.net> References: <082520050002.6866.430D0A950000327700001AD22205886360CFCFCE0E9F019D9A0A@comcast.net> Message-ID: See http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2005-July/004876.html http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2005-July/004883.html and other messages in the thread. hth, Alan Isaac From rkern at ucsd.edu Wed Aug 24 21:26:26 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 24 Aug 2005 18:26:26 -0700 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices In-Reply-To: <082520050002.6866.430D0A950000327700001AD22205886360CFCFCE0E9F019D9A0A@comcast.net> References: <082520050002.6866.430D0A950000327700001AD22205886360CFCFCE0E9F019D9A0A@comcast.net> Message-ID: <430D1E42.60608@ucsd.edu> europa100 at comcast.net wrote: > Ok, I get it. There is Maya and there is MayaVi. I got the MayaVi. What relationship is there between these two programs or whatever. None. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From europa100 at comcast.net Wed Aug 24 22:13:41 2005 From: europa100 at comcast.net (europa100 at comcast.net) Date: Thu, 25 Aug 2005 02:13:41 +0000 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices Message-ID: <082520050213.28837.430D29550002EF4A000070A52207020653CFCFCE0E9F019D9A0A@comcast.net> Thank you!! Rob. > See > http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2005-July/004876.html > http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2005-July/004883.html > and other messages in the thread. > > hth, > Alan Isaac > > > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From noel.oboyle2 at mail.dcu.ie Thu Aug 25 05:41:53 2005 From: noel.oboyle2 at mail.dcu.ie (Noel O'Boyle) Date: Thu, 25 Aug 2005 10:41:53 +0100 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices In-Reply-To: <082520050213.28837.430D29550002EF4A000070A52207020653CFCFCE0E9F019D9A0A@comcast.net> References: <082520050213.28837.430D29550002EF4A000070A52207020653CFCFCE0E9F019D9A0A@comcast.net> Message-ID: <1124962913.24505.752.camel@sandwi.ch.cam.ac.uk> Also, checkout http://cens.ioc.ee/projects/pyvtk/, PyVTK, which can be used to write VTK files from NumArray data. Regards, Noel On Thu, 2005-08-25 at 02:13 +0000, europa100 at comcast.net wrote: > Thank you!! > > Rob. > > > > See > > http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2005-July/004876.html > > http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2005-July/004883.html > > and other messages in the thread. > > > > hth, > > Alan Isaac > > > > > > > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From prabhu_r at users.sf.net Thu Aug 25 05:58:53 2005 From: prabhu_r at users.sf.net (Prabhu Ramachandran) Date: Thu, 25 Aug 2005 15:28:53 +0530 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices In-Reply-To: <430D1E42.60608@ucsd.edu> References: <082520050002.6866.430D0A950000327700001AD22205886360CFCFCE0E9F019D9A0A@comcast.net> <430D1E42.60608@ucsd.edu> Message-ID: <17165.38493.355835.757998@monster.linux.in> >>>>> "Robert" == Robert Kern writes: Robert> europa100 at comcast.net wrote: >> Ok, I get it. There is Maya and there is MayaVi. I got the >> MayaVi. What relationship is there between these two programs >> or whatever. Robert> None. Yes that is correct. My ignorance 4 years ago (when I picked the name MayaVi) is the cause for the confusion. However, if you read the first paragraph of the mayavi site it should be evident that MayaVi has nothing to do whatsoever with Maya. Choosing a name (that I liked) took quite a bit of time and at the time I did not think of Maya. IIRC I searched on google for MayaVi and had no relevant hits and figured that I could use the name. As Ryan Krauss said, it might take a little while and patience to figure out the VTK file formats. However there is (terse) documentation on the VTK file format and there is pyvtk (which Noel has mentioned). The trouble with a generic 3D data visualizer is that 3D data *is* inherently harder to represent. However, I do see that it could be better documented and made a little easier. I'll keep that in mind for the future. cheers, prabhu From europa100 at comcast.net Thu Aug 25 06:16:17 2005 From: europa100 at comcast.net (europa100 at comcast.net) Date: Thu, 25 Aug 2005 10:16:17 +0000 Subject: [SciPy-user] A simple 3d OpenGL viewer and color map for matrices Message-ID: <082520051016.29392.430D9A70000DDDB0000072D02200751150CFCFCE0E9F019D9A0A@comcast.net> Dear Prabdu, Thank you for the information, and software. I will try to follow the directions given to me earlier to get MayaVi up and running. Actually, I should have known better that Maya did not look like the same thing that I tried out a couple of years ago. I think your name for the project is fine. I just need a little help these days navigating the current Python oriented packages Python ToyFDTD will be a logical place to experiment with new visualization schemes for my small simulation programs. I would like to experiment on Windoze to get to the point of something I can write up as a HOWto doc on dumping these simple data arrays and then using a much more complicated vis package to view them. Then I will convert all my programs on my site to that format. It will take some time. I will try to use Windoze at first. Rob. > >>>>> "Robert" == Robert Kern writes: > > Robert> europa100 at comcast.net wrote: > >> Ok, I get it. There is Maya and there is MayaVi. I got the > >> MayaVi. What relationship is there between these two programs > >> or whatever. > > Robert> None. > > Yes that is correct. My ignorance 4 years ago (when I picked the name > MayaVi) is the cause for the confusion. However, if you read the > first paragraph of the mayavi site it should be evident that MayaVi > has nothing to do whatsoever with Maya. > > Choosing a name (that I liked) took quite a bit of time and at the > time I did not think of Maya. IIRC I searched on google for MayaVi > and had no relevant hits and figured that I could use the name. > > As Ryan Krauss said, it might take a little while and patience to > figure out the VTK file formats. However there is (terse) > documentation on the VTK file format and there is pyvtk (which Noel > has mentioned). The trouble with a generic 3D data visualizer is that > 3D data *is* inherently harder to represent. However, I do see that > it could be better documented and made a little easier. I'll keep > that in mind for the future. > > cheers, > prabhu > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From ckkart at hoc.net Thu Aug 25 07:03:33 2005 From: ckkart at hoc.net (Christian Kristukat) Date: Thu, 25 Aug 2005 13:03:33 +0200 Subject: [SciPy-user] problem using interp2d In-Reply-To: <6ef8f33805082404556ca3ce38@mail.gmail.com> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> <6ef8f33805082404556ca3ce38@mail.gmail.com> Message-ID: <430DA585.3040301@hoc.net> Pau Gargallo wrote: > i'm having exactly the same problem and i posted the same question 2 > minutes before reciving your message (sometimes the world surprise > me). > > interp2d seems to be unfinished and last edited 2 years ago. > I tried to get 2d interpolation to work without success some month ago and finally I found an alternative. CDAT (http://esg.llnl.gov/cdat/) has a standalone python module for 2d interpolation called natgrid. It works like a charm. You can feed in a cloud of points and you get back interpolated data on a rectangular grid. It would be very nice to have this included in scipy. Regards, Christian From rkern at ucsd.edu Thu Aug 25 07:48:52 2005 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 25 Aug 2005 04:48:52 -0700 Subject: [SciPy-user] problem using interp2d In-Reply-To: <430DA585.3040301@hoc.net> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> <6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net> Message-ID: <430DB024.7090300@ucsd.edu> Christian Kristukat wrote: > I tried to get 2d interpolation to work without success some month ago > and finally I found an alternative. CDAT (http://esg.llnl.gov/cdat/) has > a standalone python module for 2d interpolation called natgrid. It works > like a charm. You can feed in a cloud of points and you get back > interpolated data on a rectangular grid. > > It would be very nice to have this included in scipy. Unfortunately, we cannot use natgrid directly since it is GPLed (it comes from NCAR Graphics). http://ngwww.ucar.edu/ng4.4/ Hmm, CDAT as a whole seems to prohibit commercial use. Naughty of them. The website of the original author of natural-neighbor interpolation algorithm, Dave Watson, does not appear to be online at the moment. If someone wants to code the algorithm using the available literature, we'd be more than happy to include it. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From ckkart at hoc.net Thu Aug 25 09:22:34 2005 From: ckkart at hoc.net (Christian Kristukat) Date: Thu, 25 Aug 2005 15:22:34 +0200 Subject: [SciPy-user] problem using interp2d In-Reply-To: <430DB024.7090300@ucsd.edu> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> <6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net> <430DB024.7090300@ucsd.edu> Message-ID: <430DC61A.6040104@hoc.net> Robert Kern wrote: > Christian Kristukat wrote: > > >>I tried to get 2d interpolation to work without success some month ago >>and finally I found an alternative. CDAT (http://esg.llnl.gov/cdat/) has >>a standalone python module for 2d interpolation called natgrid. It works >>like a charm. You can feed in a cloud of points and you get back >>interpolated data on a rectangular grid. >> >>It would be very nice to have this included in scipy. > > > Unfortunately, we cannot use natgrid directly since it is GPLed (it > comes from NCAR Graphics). > > http://ngwww.ucar.edu/ng4.4/ > > Hmm, CDAT as a whole seems to prohibit commercial use. Naughty of them. > > The website of the original author of natural-neighbor interpolation > algorithm, Dave Watson, does not appear to be online at the moment. > > If someone wants to code the algorithm using the available literature, > we'd be more than happy to include it. > I found Dave Watson's code on the webpage of the "International Association for Mathematical Geology" http://www.iamg.org/naturalneighbour.html It doesn't say anything about copyright. Does that mean it is free to use/spread? Regards, Christian From rkern at ucsd.edu Thu Aug 25 09:32:54 2005 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 25 Aug 2005 06:32:54 -0700 Subject: [SciPy-user] problem using interp2d In-Reply-To: <430DC61A.6040104@hoc.net> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> <6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net> <430DB024.7090300@ucsd.edu> <430DC61A.6040104@hoc.net> Message-ID: <430DC886.8030403@ucsd.edu> Christian Kristukat wrote: > I found Dave Watson's code on the webpage of the "International > Association for Mathematical Geology" > > http://www.iamg.org/naturalneighbour.html > > It doesn't say anything about copyright. Does that mean it is free to > use/spread? No. The exact opposite, in fact. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From boyle5 at llnl.gov Thu Aug 25 10:35:39 2005 From: boyle5 at llnl.gov (James Boyle) Date: Thu, 25 Aug 2005 07:35:39 -0700 Subject: [SciPy-user] problem using interp2d In-Reply-To: <430DC886.8030403@ucsd.edu> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> <6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net> <430DB024.7090300@ucsd.edu> <430DC61A.6040104@hoc.net> <430DC886.8030403@ucsd.edu> Message-ID: <67dc3d0b6e203b989b4963a355571438@llnl.gov> An implementation of Watson's code is provided in NCAR Graphics v. 4.4. The routine the specific code is called natgrid in the NgMath package. There are several packages for interpolation which are robust and I find work very well. NCAR Graphics are freely available in source and binary BUT under the GNU GPL - I am blissfully ignorant of the implications of the GPL but for personal use NCARG is the only place to get Watson's rather nice algorithm. --Jim On Aug 25, 2005, at 6:32 AM, Robert Kern wrote: > Christian Kristukat wrote: > >> I found Dave Watson's code on the webpage of the "International >> Association for Mathematical Geology" >> >> http://www.iamg.org/naturalneighbour.html >> >> It doesn't say anything about copyright. Does that mean it is free to >> use/spread? > > No. The exact opposite, in fact. > > -- > Robert Kern > rkern at ucsd.edu > > "In the fields of hell where the grass grows high > Are the graves of dreams allowed to die." > -- Richard Harter > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From vincent.alcouffe at newlogic.fr Thu Aug 25 10:47:11 2005 From: vincent.alcouffe at newlogic.fr (Vincent Alcouffe) Date: Thu, 25 Aug 2005 16:47:11 +0200 Subject: [SciPy-user] io.savemat function Message-ID: <430DD9EF.6080305@newlogic.fr> Hi, I'm using the io.savemat function of Scipy package. Everything works well with Python 2.3 and Scipy 0.3.2 I'm now using python 2.4. But I had troubles to install Scipy 0.3.2. with Python2.4. But I still want to use somehow the io.savemat function. Is there a way in Python 2.4 to generate matlab files (.mat) without using the io,savemat from Scipy? -Vincent From richter at hephy.oeaw.ac.at Thu Aug 25 14:48:18 2005 From: richter at hephy.oeaw.ac.at (Gerald Richter) Date: Thu, 25 Aug 2005 20:48:18 +0200 Subject: [SciPy-user] interp2d ? In-Reply-To: <6ef8f3380508240436634cff5f@mail.gmail.com> References: <6ef8f3380508240436634cff5f@mail.gmail.com> Message-ID: <20050825184818.GA2483@uroboros.hephy.oeaw.ac.at> Not too long ago I had to use a 2-dimensional interpolation function. What I did, was look into the code of octve, and reimplement the function in python for the linear interpolation... the code is about 6 Months old, so I'm not sure, if I know wht it does ;), but if you need it, feel free to use it... (attached). regards, Gerald. On Wed, Aug 24, 2005 at 01:36:51PM +0200, Pau Gargallo wrote: > Hi, > > i'm looking for functions (like interp2 in octave) for interpolating > arrays. For example for transforming an image from Cartesian to polar > coordinates. > > The function interp2d in scipy/interpolate/interpolate.py is > unfinished and last changes had been done 2 years ago :_( > > Also, the tutorial.pdf talks about the function interpolate.linear_1d > which i can not find. > > can someone help me? > should i program these functions myself? > would my code be welcome? > > tanks for everything you are doing! > > pau > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- Gerald Richter phone: +43 1 5447328/27 Institute of high energy physics (HEPHY) http://wwwhephy.oeaw.ac.at/ Vienna/Austria -------------- next part -------------- A non-text attachment was scrubbed... Name: myinterp2.py Type: text/x-python Size: 11173 bytes Desc: not available URL: From brombo at comcast.net Thu Aug 25 15:42:02 2005 From: brombo at comcast.net (Alan Bromborsky) Date: Thu, 25 Aug 2005 15:42:02 -0400 Subject: [SciPy-user] X11 Build Problem Message-ID: <430E1F0A.5010404@comcast.net> I am trying to build SciPy on the following system: Fedora Core 3 X86_64 Dual Opteron processors Python 2.3.4 I get the error during linking that the linker cannot find -lX11. On my system it is in '/usr/X11R6/lib64'. Note that setup_xplt.py uses get_info('x11'). The actual error messages are: */usr/bin/ld: cannot find -lX11 collect2: ld returned 1 exit status /usr/bin/ld: cannot find -lX11 collect2: ld returned 1 exit status error: Command "gcc -pthread -shared build/temp.linux-x86_64-2.3/Lib/xplt/pygist/gistCmodule.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/gist.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/tick.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/tick60.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/engine.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/gtext.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/draw.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/draw0.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/clip.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/gread.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/gcntr.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/hlevel.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/ps.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/cgm.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/eps.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/style.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/xfancy.o build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/xbasic.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/dir.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/files.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/fpuset.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/pathnm.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/timew.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/uevent.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/ugetc.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/umain.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/usernm.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/slinks.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/colors.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/connect.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/cursors.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/errors.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/events.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/fills.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/fonts.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/images.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/lines.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/pals.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/pwin.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/resource.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/rgbread.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/textout.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/rect.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/clips.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/points.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/hash.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/hash0.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/mm.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/alarms.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/pstrcpy.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/pstrncat.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/p595.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/bitrev.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/bitlrot.o build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/bitmrot.o -LLib/xplt/. -LLib/xplt/src -L/usr/lib -Lbuild/temp.linux-x86_64-2.3 -lX11 -lm -o build/lib.linux-x86_64-2.3/scipy/xplt/gistC.so" failed with exit status 1 *Any suggestions would be appreciated!* * -------------- next part -------------- An HTML attachment was scrubbed... URL: From aisaac at american.edu Thu Aug 25 17:27:49 2005 From: aisaac at american.edu (Alan G Isaac) Date: Thu, 25 Aug 2005 17:27:49 -0400 Subject: [SciPy-user] interp2d ? In-Reply-To: <20050825184818.GA2483@uroboros.hephy.oeaw.ac.at> References: <6ef8f3380508240436634cff5f@mail.gmail.com> <20050825184818.GA2483@uroboros.hephy.oeaw.ac.at> Message-ID: On Thu, 25 Aug 2005, Gerald Richter apparently wrote: > if you need it, feel free to use it... Does that translate to: "this is in the public domain"? Cheers, Alan Isaac From cdavis at staffmail.ed.ac.uk Fri Aug 26 06:05:45 2005 From: cdavis at staffmail.ed.ac.uk (Cory Davis) Date: Fri, 26 Aug 2005 11:05:45 +0100 Subject: [SciPy-user] X11 Build Problem In-Reply-To: <430E1F0A.5010404@comcast.net> References: <430E1F0A.5010404@comcast.net> Message-ID: <430EE979.5060302@staffmail.ed.ac.uk> Hi there, Its been a while since I built scipy, but this might work ... python setup.py build_ext --library-dirs=/usr/X11R6/lib64 install HTH Cory. Alan Bromborsky wrote: > I am trying to build SciPy on the following system: > Fedora Core 3 X86_64 > Dual Opteron processors > Python 2.3.4 > > I get the error during linking that the linker cannot find -lX11. On my > system it is in '/usr/X11R6/lib64'. Note that setup_xplt.py uses > get_info('x11'). The actual error messages are: > > */usr/bin/ld: cannot find -lX11 > collect2: ld returned 1 exit status > /usr/bin/ld: cannot find -lX11 > collect2: ld returned 1 exit status > error: Command "gcc -pthread -shared > build/temp.linux-x86_64-2.3/Lib/xplt/pygist/gistCmodule.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/gist.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/tick.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/tick60.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/engine.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/gtext.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/draw.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/draw0.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/clip.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/gread.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/gcntr.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/hlevel.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/ps.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/cgm.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/eps.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/style.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/xfancy.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/gist/xbasic.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/dir.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/files.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/fpuset.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/pathnm.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/timew.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/uevent.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/ugetc.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/umain.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/usernm.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/unix/slinks.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/colors.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/connect.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/cursors.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/errors.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/events.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/fills.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/fonts.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/images.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/lines.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/pals.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/pwin.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/resource.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/rgbread.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/textout.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/rect.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/clips.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/x11/points.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/hash.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/hash0.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/mm.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/alarms.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/pstrcpy.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/pstrncat.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/p595.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/bitrev.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/bitlrot.o > build/temp.linux-x86_64-2.3/Lib/xplt/src/play/all/bitmrot.o -LLib/xplt/. > -LLib/xplt/src -L/usr/lib -Lbuild/temp.linux-x86_64-2.3 -lX11 -lm -o > build/lib.linux-x86_64-2.3/scipy/xplt/gistC.so" failed with exit status 1 > > *Any suggestions would be appreciated!* > > > * > > > ------------------------------------------------------------------------ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- --------------------------------------------------- Cory Davis Institute for Atmospheric and Environmental Science Room 307, Crew Building, Kings Buildings, University of Edinburgh. Edinburgh EH9 3JN phone: +44 131 6505092 www: http://www.geos.ed.ac.uk/contacts/homes/cdavis From arnd.baecker at web.de Fri Aug 26 07:32:30 2005 From: arnd.baecker at web.de (Arnd Baecker) Date: Fri, 26 Aug 2005 13:32:30 +0200 (CEST) Subject: [SciPy-user] new debian in science group Message-ID: Hi, I thought it might be of interest to some that a debian-science mailing list has been created. Quoting debian-weekly: Debian Science Group. Helen Faulkner [14]announced the creation of the [15]debian-science mailing list. It is aimed to encourage discussions about how best to [16]use Debian as an operating system for scientific research and how to improve Debian by making it more useful to scientists and people working in related fields. It should also provide an address for scientists where they can ask questions about Debian or software in Debian and get useful answers. 14. http://lists.debian.org/debian-devel/2005/07/msg01555.html 15. http://lists.debian.org/debian-science/ 16. http://wiki.debian.net/?DebianScience Best, Arnd From arnd.baecker at web.de Fri Aug 26 13:09:53 2005 From: arnd.baecker at web.de (Arnd Baecker) Date: Fri, 26 Aug 2005 19:09:53 +0200 (CEST) Subject: [SciPy-user] Re: [Matplotlib-users] new debian in science group In-Reply-To: References: Message-ID: On Fri, 26 Aug 2005, Rich Shepard wrote: > On Fri, 26 Aug 2005, Arnd Baecker wrote: > > > I thought it might be of interest to some that a debian-science mailing > > list has been created. Quoting debian-weekly: > > It's unfortunate that the effort is distribution-specific. After all the > work to remove such differences from various distributions it's counter > productive to try to re-instate divisions. Have you actually read the part you snipped away in your reply? > Perhaps others of us should > promote a Slackware-science group. Or, a Gentoo-science group. Just go ahead for slackware. For Gentoo see: http://www.gentoo.org/proj/en/desktop/science/index.xml > Silly. > > Rich Must be Friday, best, Arnd From brombo at comcast.net Fri Aug 26 14:08:53 2005 From: brombo at comcast.net (Alan Bromborsky) Date: Fri, 26 Aug 2005 14:08:53 -0400 Subject: [SciPy-user] pygist drivers Message-ID: <430F5AB5.4040807@comcast.net> When plotting I usually have my python program write and execute a gnuplot script. I do this because gnuplot has a LaTeX driver so that I can use all the LaTeX symbols to annotate my graphs. Does pygist have a LaTeX driver? From fred at ucar.edu Fri Aug 26 14:10:16 2005 From: fred at ucar.edu (Fred Clare) Date: Fri, 26 Aug 2005 12:10:16 -0600 Subject: [SciPy-user] problem using interp2d In-Reply-To: <67dc3d0b6e203b989b4963a355571438@llnl.gov> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za> <6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net> <430DB024.7090300@ucsd.edu> <430DC61A.6040104@hoc.net> <430DC886.8030403@ucsd.edu> <67dc3d0b6e203b989b4963a355571438@llnl.gov> Message-ID: <1fbdcf9b28be14ecfad79ae27ea1da0e@ucar.edu> We would like to fill in a little history of the Natgrid function in NCAR Graphics. Natgrid is based on Dave Watson's original code "nngridr." "nngridr" was written in C as a stand-alone interactive application - it asked for input from standard input and produced output to standard output. In the mid 1990s we contacted Dr. Watson about whether he would give permission for us to adapt "nngridr" to make it a function call and incorporate that into our packages, with permission to redistribute. The deal he gave us was that he would allow this under the conditions: 1.) We purchase his book "nngridr - An Implementation of Natural Neighbor Interpolation" (which he published privately). 2.) We call the function something other than "nngridr." 3.) We provide adequate documentation. He gave this permission in the interests of having natural neighbor algorithms reach a wider audience. Our first release of Natgrid, with Fortran and C interfaces, http://ngwww.ucar.edu/ngdoc/ng/ngmath/natgrid/nnhome.html was in 1996 as part of the Ngmath library. Subsequently, an NCL version was implemented: http://www.ncl.ucar.edu/Document/Functions/Built-in/natgrid.shtml and more recently a Python interface was provided as part of our PyNGL package: http://www.pyngl.ucar.edu/appendixa.html#Ngl.natgrid An example of the Python interface to Natgrid can be found at in one of the PyNGL tutorial examples at: http://www.pyngl.ucar.edu/examples/ngl08p.html The e-mail addresses and web sites we referenced in dealing with Dr. Watson are no longer in service. Watson's book, "Contouring: A Guide to the Analysis and Display of Spatial Data" (which is really a book about interpolation methods) is still available from Amazon: http://www.amazon.com/exec/obidos/tg/detail/-/0080402860/ qid=1124995478/sr=1-1/ref=sr_1_1/103-2345311-4016630?v=glance&s=books Fred Clare fred at ucar.edu From syd.diamond at gmail.com Fri Aug 26 18:46:37 2005 From: syd.diamond at gmail.com (Syd Diamond) Date: Fri, 26 Aug 2005 18:46:37 -0400 Subject: [SciPy-user] getting the "best" two eigenvectors for a PCA analysis with a power method Message-ID: I'll be honest -- I'm mostly interested in the end not the means right now. I need to find the first and second principal components of a 120x520 matrix. Right now, I'm using the "from LinearAlgebra import eigenvectors" method to find eigenvectors of the covariance matrix. This worked fine for my 120x90 matrix, but it's choking on the 120x520 matrix. When I talked to a friend, he said usually shortcuts were taken... like the power method for computing the dominant eigenpair. I've googled around without any luck. Can anyone please give me some guidance here? In return, I can offer some hilariously inefficient code from a guy who still doesn't know what he's doing... enjoy :) Thank you everyone for your continued help. (And if you can offer guidance on the code as well, by all means be my guest :)) from Numeric import array, zeros, shape, Float from LinearAlgebra import eigenvectors from scipy import mean, std, cov def princomp(X): evals, evecs = eigenvectors(cov(X)) eSorter = {} for index in xrange(len(evals)): eval = evals[index] evec = evecs[index] eSorter[eval] = evec evalsList = eSorter.keys().sort() evecNew = zeros(shape(evecs), typecode=Float) counter = 0 for eval in evals: evec = eSorter[eval] evecNew[counter] = evec counter += 1 return evecNew From vinicius.nascimento at gmail.com Fri Aug 26 20:14:56 2005 From: vinicius.nascimento at gmail.com (Vinicius Franco do Nascimento) Date: Fri, 26 Aug 2005 21:14:56 -0300 Subject: [SciPy-user] Suggested Linux Distribution? In-Reply-To: References: Message-ID: <62524b7805082617145e8d084d@mail.gmail.com> use Ubuntu Linux, Ubuntu is the best friend of Python :) www.ubuntulinux.org/ On 8/17/05, Greg Novak wrote: > This is somewhat off topic, but the readers of this list should be well > qualified to answer. I'm having trouble getting scipy to compile on > Fedora Core 4 (see my posting to the scipy-dev list for details), and this > message seems to indicate that it's just not working at the moment: > > http://www.scipy.net/pipermail/scipy-dev/2005-June/003041.html > > Can people recommend a Linux distribution that "just works" for scientific > computing? I'm asking the list because I expect that the audience is > similar to me: comfortable using a command line, comfortable building > software, but really not wanting to deal with debugging shared library > problems. > > It would probably be better if people replied to me directly and then I > will summarize the results and re-post to the list. It seems like this > would avoid a lot of redundant posts and also the potential flame war. > > Thanks for any input, > Greg > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -- ================================ Vin?cius Franco do Nascimento vinicius.nascimento at gmail.com http://vinicius.objectis.net/ From rkern at ucsd.edu Fri Aug 26 20:57:24 2005 From: rkern at ucsd.edu (Robert Kern) Date: Fri, 26 Aug 2005 17:57:24 -0700 Subject: [SciPy-user] getting the "best" two eigenvectors for a PCA analysis with a power method In-Reply-To: References: Message-ID: <430FBA74.8080907@ucsd.edu> Syd Diamond wrote: > I'll be honest -- I'm mostly interested in the end not the means right > now. I need to find the first and second principal components of a > 120x520 matrix. > > Right now, I'm using the "from LinearAlgebra import eigenvectors" > method to find eigenvectors of the covariance matrix. This worked > fine for my 120x90 matrix, but it's choking on the 120x520 matrix. Use the SVD instead (after subtracting out the mean vector). It's equivalent. It works quite quickly on my G4 Powerbook with a 120x520 matrix. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From lindeman at bard.edu Sat Aug 27 11:11:38 2005 From: lindeman at bard.edu (lindeman at bard.edu) Date: Sat, 27 Aug 2005 11:11:38 -0400 Subject: [SciPy-user] use of rv_continuous "fit"? Message-ID: <1125155498.431082aa9dcd7@webmail.bard.edu> Evidently I haven't grasped the Zen of SciPy's rv_continuous classes. I am trying to compose a simple snippet of code that would fit a normal curve to a vector of data (say, [-2.0, -1.0, -0.5, 0.0, 0.5, 1.0, 2.0]) -- which .fit seems that it ought to do, with about three lines of code, but I can't figure out the three lines. And I can't seem to find a single use of .fit anywhere on the Web. Sigh. Could someone please rescue the newbie? Best, Mark Lindeman From aisaac at american.edu Fri Aug 26 21:35:36 2005 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 26 Aug 2005 21:35:36 -0400 Subject: [SciPy-user] problem using interp2d In-Reply-To: <1fbdcf9b28be14ecfad79ae27ea1da0e@ucar.edu> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za><6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net><430DB024.7090300@ucsd.edu> <430DC61A.6040104@hoc.net><430DC886.8030403@ucsd.edu> <67dc3d0b6e203b989b4963a355571438@llnl.gov><1fbdcf9b28be14ecfad79ae27ea1da0e@ucar.edu> Message-ID: On Fri, 26 Aug 2005, Fred Clare apparently wrote: > The deal he gave us was that > he would allow this under the conditions: > 1.) We purchase his book "nngridr - An Implementation of > Natural Neighbor Interpolation" (which he published privately). > 2.) We call the function something other than "nngridr." > 3.) We provide adequate documentation. Was the copyright for this release discussed? And what is the copyright on the original code? Has that been clarified since? Cheers, Alan Isaac From europa100 at comcast.net Sat Aug 27 20:31:09 2005 From: europa100 at comcast.net (Rob) Date: Sat, 27 Aug 2005 17:31:09 -0700 Subject: [SciPy-user] animabob cygwin Message-ID: <431105CD.2030004@comcast.net> At one time I actually believed I understood the GNU tools that I used to make Animabob-Cygwin. But I can't compile it now. Can anyone help out so that I can write up a procedure for installiing it in Cygwin ? I am at a loss, as I can't even get X to work right in Cygwin. Rob From t.zito at biologie.hu-berlin.de Mon Aug 29 03:23:28 2005 From: t.zito at biologie.hu-berlin.de (Tiziano Zito) Date: Mon, 29 Aug 2005 09:23:28 +0200 Subject: [SciPy-user] getting the "best" two eigenvectors for a PCA analysis with a power method In-Reply-To: References: Message-ID: <20050829072328.GA5148@itb.biologie.hu-berlin.de> On Fri 26 Aug, 18:46, Syd Diamond wrote: > I'll be honest -- I'm mostly interested in the end not the means right > now. I need to find the first and second principal components of a > 120x520 matrix. The package 'MDP' http://mdp-toolkit.sourceforge.net together with 'symeig' http://mdp-toolkit.sourceforge.net/symeig.html offers taht functionality (and much more). Note that results are much faster than standard eigenvalue problem solution with scipy.linalg.eig. After installing MDP and symeig you can simply do: >>> import mdp >>> out = mdp.pca(input_data, output_dim = 2) From gnata at obs.univ-lyon1.fr Mon Aug 29 08:47:57 2005 From: gnata at obs.univ-lyon1.fr (Xavier Gnata) Date: Mon, 29 Aug 2005 14:47:57 +0200 Subject: [SciPy-user] No recent windows binaries? Message-ID: <431303FD.9090904@obs.univ-lyon1.fr> Hi, Scipy under Linux is just great but the last release is so old (October 9, 2004) that we have to compile the current CVS version. It is not really a problem under Linux but it is impossible to do that under windows using a free compiler (you need Visual C++ .NET...) Is there any python version compiled with a free compiler under windows (eg with devcpp)? Is there more recent precompiled windows versions ?? I do not ask for a daily compiled CVS version but compiling only one version per year doesn't not make sense IMHO. Xavier. From rkern at ucsd.edu Mon Aug 29 09:03:02 2005 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 29 Aug 2005 06:03:02 -0700 Subject: [SciPy-user] No recent windows binaries? In-Reply-To: <431303FD.9090904@obs.univ-lyon1.fr> References: <431303FD.9090904@obs.univ-lyon1.fr> Message-ID: <43130786.7000902@ucsd.edu> Xavier Gnata wrote: > Hi, > > Scipy under Linux is just great but the last release is so old (October > 9, 2004) that we have to compile the current CVS version. > It is not really a problem under Linux but it is impossible to do that > under windows using a free compiler (you need Visual C++ .NET...) John Hunter has had success compiling matplotlib for Python 2.4.1 on Windows with mingw. http://mail.python.org/pipermail/python-list/2004-December/254826.html > Is there any python version compiled with a free compiler under windows > (eg with devcpp)? > > Is there more recent precompiled windows versions ?? I do not ask for a > daily compiled CVS version but compiling only one version per year > doesn't not make sense IMHO. Not at the moment, but people are working on cutting one last release (with binaries) before the big reorganization. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From stefan at sun.ac.za Mon Aug 29 09:12:01 2005 From: stefan at sun.ac.za (Stefan van der Walt) Date: Mon, 29 Aug 2005 15:12:01 +0200 Subject: [SciPy-user] blitz question (slightly off-topic) Message-ID: <20050829131201.GE31647@strongbad.dsp.sun.ac.za> Hi All, This question is slightly off-topic -- I apologise. I cannot contact the Blitz-developers, and hope that someone on this list is knowledgeable enough to help out. The type in question is, of course, a Numeric array. I convert from Numeric arrays to Blitz matrices without problems, but the other way around poses problems. Thanks in advance. St?fan From: Stefan van der Walt To: blitz-support at lists.sf.net Subject: hijacking an array Hi, I am trying to export a Blitz Array to another library's array type. To do that (without copying data), I need to grab access to the Array's data, and then destroy the original Array object. Something like Take a Blitz Array and "stick 'em up": 1. Tell me where you keep your data (in a non-const non-restricted pointer) 2. Run, leaving your data here with me. Or in pseudo-code otherobj convert_to_otherobj(Array M&) { otherobj.data_p = M.unrestricted_data(); // set otherobj size etc. M.set_policy(neverDeleteData); return otherobj; } // M goes out of scope and gets destroyed, but data is left behind Can someone please tell me how to accomplish this? Or describe a better way of doing this? Thanks St?fan From gnata at obs.univ-lyon1.fr Mon Aug 29 09:19:42 2005 From: gnata at obs.univ-lyon1.fr (Xavier Gnata) Date: Mon, 29 Aug 2005 15:19:42 +0200 Subject: [SciPy-user] No recent windows binaries? In-Reply-To: <43130786.7000902@ucsd.edu> References: <431303FD.9090904@obs.univ-lyon1.fr> <43130786.7000902@ucsd.edu> Message-ID: <43130B6E.7060206@obs.univ-lyon1.fr> Robert Kern wrote: >Xavier Gnata wrote: > > >>Hi, >> >>Scipy under Linux is just great but the last release is so old (October >>9, 2004) that we have to compile the current CVS version. >>It is not really a problem under Linux but it is impossible to do that >>under windows using a free compiler (you need Visual C++ .NET...) >> >> > >John Hunter has had success compiling matplotlib for Python 2.4.1 on >Windows with mingw. > >http://mail.python.org/pipermail/python-list/2004-December/254826.html > > > Great news :) I will try that. >>Is there any python version compiled with a free compiler under windows >>(eg with devcpp)? >> >>Is there more recent precompiled windows versions ?? I do not ask for a >>daily compiled CVS version but compiling only one version per year >>doesn't not make sense IMHO. >> >> > >Not at the moment, but people are working on cutting one last release >(with binaries) before the big reorganization. > > > Is this reorganisation only related to the new numarray/numerics design (numeric3) or is there something else? Xavier From shuntim.luk at polyu.edu.hk Mon Aug 29 09:21:19 2005 From: shuntim.luk at polyu.edu.hk (LUK ShunTim) Date: Mon, 29 Aug 2005 21:21:19 +0800 Subject: [SciPy-user] No recent windows binaries? In-Reply-To: <43130786.7000902@ucsd.edu> References: <431303FD.9090904@obs.univ-lyon1.fr> <43130786.7000902@ucsd.edu> Message-ID: <43130BCF.9070000@polyu.edu.hk> Robert Kern wrote: > Xavier Gnata wrote: > >>Hi, >> >>Scipy under Linux is just great but the last release is so old (October >>9, 2004) that we have to compile the current CVS version. >>It is not really a problem under Linux but it is impossible to do that >>under windows using a free compiler (you need Visual C++ .NET...) > > > John Hunter has had success compiling matplotlib for Python 2.4.1 on > Windows with mingw. > > http://mail.python.org/pipermail/python-list/2004-December/254826.html > > >>Is there any python version compiled with a free compiler under windows >>(eg with devcpp)? >> >>Is there more recent precompiled windows versions ?? I do not ask for a >>daily compiled CVS version but compiling only one version per year >>doesn't not make sense IMHO. > > > Not at the moment, but people are working on cutting one last release > (with binaries) before the big reorganization. > Here's one site that you may find useful. http://jove.prohosting.com/iwave/ipython/pyMinGW.html Regards, ST -- From rkern at ucsd.edu Mon Aug 29 10:33:15 2005 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 29 Aug 2005 07:33:15 -0700 Subject: [SciPy-user] No recent windows binaries? In-Reply-To: <43130B6E.7060206@obs.univ-lyon1.fr> References: <431303FD.9090904@obs.univ-lyon1.fr> <43130786.7000902@ucsd.edu> <43130B6E.7060206@obs.univ-lyon1.fr> Message-ID: <43131CAB.4010101@ucsd.edu> Xavier Gnata wrote: > Is this reorganisation only related to the new numarray/numerics design > (numeric3) or is there something else? It is primarily motivated by the transition to the new Numeric, yes, but I'm sure there will be other changes, too. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From oliphant at ee.byu.edu Mon Aug 29 14:13:58 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Mon, 29 Aug 2005 12:13:58 -0600 Subject: [SciPy-user] use of rv_continuous "fit"? In-Reply-To: <1125155498.431082aa9dcd7@webmail.bard.edu> References: <1125155498.431082aa9dcd7@webmail.bard.edu> Message-ID: <43135066.9070705@ee.byu.edu> lindeman at bard.edu wrote: >Evidently I haven't grasped the Zen of SciPy's rv_continuous classes. I am >trying to compose a simple snippet of code that would fit a normal curve to a >vector of data (say, [-2.0, -1.0, -0.5, 0.0, 0.5, 1.0, 2.0]) -- which .fit seems >that it ought to do, with about three lines of code, but I can't figure out the >three lines. And I can't seem to find a single use of .fit anywhere on the Web. >Sigh. Could someone please rescue the newbie? > > The idea is that this should be simple, but the .fit method has not been tested extensively. With that caveat, I'm not sure I understand what you mean about fitting a normal curve to your vector of "data." What exactly are you trying to do here? Are you fitting a function to a normal curve? or are you estimating the parameters of the normal distribution using data which represents samples drawn from a normal distribution. The .fit method is for the latter. Use something in optimize (i.e. optimize.leastsq) for the former. -Travis O. From fred at ucar.edu Mon Aug 29 16:48:12 2005 From: fred at ucar.edu (Fred Clare) Date: Mon, 29 Aug 2005 14:48:12 -0600 Subject: [SciPy-user] problem using interp2d In-Reply-To: References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za><6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net><430DB024.7090300@ucsd.edu> <430DC61A.6040104@hoc.net><430DC886.8030403@ucsd.edu> <67dc3d0b6e203b989b4963a355571438@llnl.gov><1fbdcf9b28be14ecfad79ae27ea1da0e@ucar.edu> Message-ID: <6a089b0fad8ba656b7e7d410e7a62f90@ucar.edu> On Aug 26, 2005, at 7:35 PM, Alan G Isaac wrote: > On Fri, 26 Aug 2005, Fred Clare apparently wrote: >> The deal he gave us was that >> he would allow this under the conditions: >> 1.) We purchase his book "nngridr - An Implementation of >> Natural Neighbor Interpolation" (which he published >> privately). >> 2.) We call the function something other than "nngridr." >> 3.) We provide adequate documentation. > > Was the copyright for this release discussed? UCAR holds the copyright for all files in our distribution and they are distributed under the GPL as noted in the prologue to each file. > And what is the copyright on the original code? Dave Watson retains the copyright to his original "nngridr" code. Fred Clare From lindeman at bard.edu Mon Aug 29 16:48:23 2005 From: lindeman at bard.edu (lindeman at bard.edu) Date: Mon, 29 Aug 2005 16:48:23 -0400 Subject: [SciPy-user] use of rv_continuous "fit"? In-Reply-To: <43135066.9070705@ee.byu.edu> References: <1125155498.431082aa9dcd7@webmail.bard.edu> <43135066.9070705@ee.byu.edu> Message-ID: <1125348503.431374975d66c@webmail.bard.edu> Travis, sorry for the enigmatic problem formulation -- yes, I mean the latter, estimating the parameters of the normal distribution using data which represents samples drawn from a normal distribution. (Obviously, my numbers aren't actually drawn from a normal distribution, which may be what threw you off.) I have assumed that I would call stats.norm.fit with a vector as the first argument -- which returns ValueError: Not enough input arguments. So far I can't find any form of second argument that doesn't return ValueError: Too many input arguments. But even when I look at the source code, I'm still not sure what I should be doing -- so evidently I am missing something pretty basic. Quoting Travis Oliphant : > lindeman at bard.edu wrote: > > >Evidently I haven't grasped the Zen of SciPy's rv_continuous classes. I am > >trying to compose a simple snippet of code that would fit a normal curve to > a > >vector of data (say, [-2.0, -1.0, -0.5, 0.0, 0.5, 1.0, 2.0]) -- which .fit > seems > >that it ought to do, with about three lines of code, but I can't figure out > the > >three lines. And I can't seem to find a single use of .fit anywhere on the > Web. > >Sigh. Could someone please rescue the newbie? > > > > > > The idea is that this should be simple, but the .fit method has not been > tested extensively. With that caveat, I'm not sure I understand what > you mean about fitting a normal curve to your vector of "data." > > What exactly are you trying to do here? Are you fitting a function to a > normal curve? or are you estimating the parameters of the normal > distribution using data which represents samples drawn from a normal > distribution. > > The .fit method is for the latter. Use something in optimize (i.e. > optimize.leastsq) for the former. > > -Travis O. > > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From rkern at ucsd.edu Mon Aug 29 17:43:11 2005 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 29 Aug 2005 14:43:11 -0700 Subject: [SciPy-user] problem using interp2d In-Reply-To: <6a089b0fad8ba656b7e7d410e7a62f90@ucar.edu> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za><6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net><430DB024.7090300@ucsd.edu> <430DC61A.6040104@hoc.net><430DC886.8030403@ucsd.edu> <67dc3d0b6e203b989b4963a355571438@llnl.gov><1fbdcf9b28be14ecfad79ae27ea1da0e@ucar.edu> <6a089b0fad8ba656b7e7d410e7a62f90@ucar.edu> Message-ID: <4313816F.5010404@ucsd.edu> Fred Clare wrote: > > On Aug 26, 2005, at 7:35 PM, Alan G Isaac wrote: > >> On Fri, 26 Aug 2005, Fred Clare apparently wrote: >> >>> The deal he gave us was that >>> he would allow this under the conditions: >>> 1.) We purchase his book "nngridr - An Implementation of >>> Natural Neighbor Interpolation" (which he published privately). >>> 2.) We call the function something other than "nngridr." >>> 3.) We provide adequate documentation. >> >> Was the copyright for this release discussed? > > UCAR holds the copyright for all files in our distribution > and they are distributed under the GPL as noted in the > prologue to each file. I believe Alan means to say "license" instead of "copyright" here. The broader question is, "Was this deal limited to UCAR and the inclusion of nngridr in NCAR Graphics specifically? Should we just ask Dave Watson ourselves?" >> And what is the copyright on the original code? > > Dave Watson retains the copyright to his original "nngridr" code. Your two statements are contradictory. UCAR certainly does not hold copyright on all of the files in its distribution. It holds copyright only on those parts which it has written; it has licenses to redistribute the other parts of the code like Dave Watson's code. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From aisaac at american.edu Mon Aug 29 13:53:00 2005 From: aisaac at american.edu (Alan G Isaac) Date: Mon, 29 Aug 2005 13:53:00 -0400 Subject: [SciPy-user] natural neighber interpolation Message-ID: Just noticed http://dilbert.engr.ucdavis.edu/~suku/nem/thesis.html#CODE which provides public domain Fortran code. Cheers, Alan Isaac From aisaac at american.edu Mon Aug 29 18:02:19 2005 From: aisaac at american.edu (Alan G Isaac) Date: Mon, 29 Aug 2005 18:02:19 -0400 Subject: [SciPy-user] problem using interp2d In-Reply-To: <4313816F.5010404@ucsd.edu> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za><6ef8f33805082404556ca3ce38@mail.gmail.com><430DA585.3040301@hoc.net><430DB024.7090300@ucsd.edu><430DC61A.6040104@hoc.net><430DC886.8030403@ucsd.edu><67dc3d0b6e203b989b4963a355571438@llnl.gov><1fbdcf9b28be14ecfad79ae27ea1da0e@ucar.edu><6a089b0fad8ba656b7e7d410e7a62f90@ucar.edu><4313816F.5010404@ucsd.edu> Message-ID: On Mon, 29 Aug 2005, Robert Kern apparently wrote: > I believe Alan means to say "license" instead of "copyright" here. Yes. > The broader question is, "Was this deal limited to UCAR > and the inclusion of nngridr in NCAR Graphics > specifically? Should we just ask Dave Watson ourselves?" Even though I have no immediate need for this code, I would be happy to ask Dave Watson as a small way of contributing to SciPy. Unfortunately, I have not been able to find current contact information online. Cheers, Alan Isaac From oliphant at ee.byu.edu Mon Aug 29 18:03:23 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Mon, 29 Aug 2005 16:03:23 -0600 Subject: [SciPy-user] use of rv_continuous "fit"? In-Reply-To: <1125348503.431374975d66c@webmail.bard.edu> References: <1125155498.431082aa9dcd7@webmail.bard.edu> <43135066.9070705@ee.byu.edu> <1125348503.431374975d66c@webmail.bard.edu> Message-ID: <4313862B.4010209@ee.byu.edu> lindeman at bard.edu wrote: >Travis, sorry for the enigmatic problem formulation -- yes, I mean the latter, >estimating the parameters of the normal distribution using data which represents >samples drawn from a normal distribution. (Obviously, my numbers aren't actually >drawn from a normal distribution, which may be what threw you off.) > >I have assumed that I would call stats.norm.fit with a vector as the first >argument -- which returns ValueError: Not enough input arguments. So far I can't >find any form of second argument that doesn't return ValueError: Too many input >arguments. But even when I look at the source code, I'm still not sure what I >should be doing -- so evidently I am missing something pretty basic. > > While .fit should work (and I'll get to fixing it if it is broken at some point), the Gaussian distribution represents a well studied case. The distribution is defined by its mean and variance. I would think you should just estimate the mean and variance directly using the standard formulas on your data (or using stats.mean and/or stats.var). In fact, I would like to overload the .fit function for many standard cases to use closed-form solutions to the parameter estimation instead of general optimization (what is currently done by default for everything). Thus, if data contains your vector of data, then mu = stats.mean(data) var = stats.var(data,bias=1) # I prefer the biased estimate because although it is biased # it has lower variance, and therefore, lower mean-square error. -Travis From fred at ucar.edu Mon Aug 29 18:14:15 2005 From: fred at ucar.edu (Fred Clare) Date: Mon, 29 Aug 2005 16:14:15 -0600 Subject: [SciPy-user] problem using interp2d In-Reply-To: <4313816F.5010404@ucsd.edu> References: <20050824113946.GE13994@strongbad.dsp.sun.ac.za><6ef8f33805082404556ca3ce38@mail.gmail.com> <430DA585.3040301@hoc.net><430DB024.7090300@ucsd.edu> <430DC61A.6040104@hoc.net><430DC886.8030403@ucsd.edu> <67dc3d0b6e203b989b4963a355571438@llnl.gov><1fbdcf9b28be14ecfad79ae27ea1da0e@ucar.edu> <6a089b0fad8ba656b7e7d410e7a62f90@ucar.edu> <4313816F.5010404@ucsd.edu> Message-ID: On Mon, 29 Aug 2005, Robert Kern apparently wrote: > I believe Alan means to say "license" instead of "copyright" here. The > broader question is, "Was this deal limited to UCAR and the inclusion > of > nngridr in NCAR Graphics specifically? I cite the conditions Watson gave us. There was no exclusionary provision in our agreement. > Should we just ask Dave Watson > ourselves?" If it would help clarify the situation, please do. > Your two statements are contradictory. UCAR certainly does not hold > copyright on all of the files in its distribution. It holds copyright > only on those parts which it has written; it has licenses to > redistribute the other parts of the code like Dave Watson's code. Correct. This appears in our code: /* * The code in this file is based on code written and * copyrighted (C) by Dave Watson. Dr. Watson retains the * copyright to his original code. Augmentations and changes * to Dr. Watson's code are copyrighted (C) by UCAR, 1997. */ Fred Clare From lindeman at bard.edu Mon Aug 29 18:17:33 2005 From: lindeman at bard.edu (lindeman at bard.edu) Date: Mon, 29 Aug 2005 18:17:33 -0400 Subject: [SciPy-user] use of rv_continuous "fit"? In-Reply-To: <4313862B.4010209@ee.byu.edu> References: <1125155498.431082aa9dcd7@webmail.bard.edu> <43135066.9070705@ee.byu.edu> <1125348503.431374975d66c@webmail.bard.edu> <4313862B.4010209@ee.byu.edu> Message-ID: <1125353853.4313897d4a011@webmail.bard.edu> I do realize that the normal distribution is defined by mean and variance, so this particular example is rather futile. I was deliberately trying to use a trivial example to help me figure out the calling conventions, etc. throughout the package. It's _possible_ that fit() is broken, but more likely that my understanding is. From oliphant at ee.byu.edu Mon Aug 29 19:28:39 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Mon, 29 Aug 2005 17:28:39 -0600 Subject: [SciPy-user] use of rv_continuous "fit"? In-Reply-To: <1125353853.4313897d4a011@webmail.bard.edu> References: <1125155498.431082aa9dcd7@webmail.bard.edu> <43135066.9070705@ee.byu.edu> <1125348503.431374975d66c@webmail.bard.edu> <4313862B.4010209@ee.byu.edu> <1125353853.4313897d4a011@webmail.bard.edu> Message-ID: <43139A27.6050609@ee.byu.edu> lindeman at bard.edu wrote: >I do realize that the normal distribution is defined by mean and variance, so >this particular example is rather futile. I was deliberately trying to use a >trivial example to help me figure out the calling conventions, etc. throughout >the package. It's _possible_ that fit() is broken, but more likely that my >understanding is. > > It is actually likely that .fit is broken because it and nnlf was rather loosely hacked together as an after thought to the rest of the distribution infrastructure which is in much better shape. I just ran some tests and it looks like there may be some problems. One thing that might help is that all distributions take location and scale keyword arguments, in addition, to any parameters they may have. Thus, you are always going to fit to these parameters as well. (The default initial guesses for these values are 0.0 and 1.0 which you can alter by passing keyword arguments in to fit). So, a Gaussian distribution will have no other arguments and would be called as res = stats.norm.fit(data) res would be just the location and scale parameters since there are no shape parameters. I just tried this and I get an error because of calling conventions to nnlf. This needs to be fixed. -Travis From noel.oboyle2 at mail.dcu.ie Tue Aug 30 05:15:13 2005 From: noel.oboyle2 at mail.dcu.ie (Noel O'Boyle) Date: Tue, 30 Aug 2005 10:15:13 +0100 Subject: [SciPy-user] pygist drivers In-Reply-To: <430F5AB5.4040807@comcast.net> References: <430F5AB5.4040807@comcast.net> Message-ID: <1125393313.4251.16.camel@sandwi.ch.cam.ac.uk> Maybe you would also be interested in PyX: http://pyx.sourceforge.net/ On Fri, 2005-08-26 at 14:08 -0400, Alan Bromborsky wrote: > When plotting I usually have my python program write and execute a > gnuplot script. I do this because gnuplot has a LaTeX driver so that I > can use all the LaTeX symbols to annotate my graphs. Does pygist have a > LaTeX driver? > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From ryanfedora at comcast.net Tue Aug 30 10:08:03 2005 From: ryanfedora at comcast.net (Ryan Krauss) Date: Tue, 30 Aug 2005 10:08:03 -0400 Subject: [SciPy-user] pygist drivers In-Reply-To: <1125393313.4251.16.camel@sandwi.ch.cam.ac.uk> References: <430F5AB5.4040807@comcast.net> <1125393313.4251.16.camel@sandwi.ch.cam.ac.uk> Message-ID: <43146843.6040704@comcast.net> If you need to do only 2D plots, matplolib has recently added increased LaTeX support: http://matplotlib.sourceforge.net/ Noel O'Boyle wrote: > Maybe you would also be interested in PyX: http://pyx.sourceforge.net/ > > On Fri, 2005-08-26 at 14:08 -0400, Alan Bromborsky wrote: > >>When plotting I usually have my python program write and execute a >>gnuplot script. I do this because gnuplot has a LaTeX driver so that I >>can use all the LaTeX symbols to annotate my graphs. Does pygist have a >>LaTeX driver? >> >>_______________________________________________ >>SciPy-user mailing list >>SciPy-user at scipy.net >>http://www.scipy.net/mailman/listinfo/scipy-user > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From lindeman at bard.edu Tue Aug 30 21:01:25 2005 From: lindeman at bard.edu (lindeman at bard.edu) Date: Tue, 30 Aug 2005 21:01:25 -0400 Subject: [SciPy-user] use of rv_continuous "fit"? In-Reply-To: <43139A27.6050609@ee.byu.edu> References: <1125155498.431082aa9dcd7@webmail.bard.edu> <43135066.9070705@ee.byu.edu> <1125348503.431374975d66c@webmail.bard.edu> <4313862B.4010209@ee.byu.edu> <1125353853.4313897d4a011@webmail.bard.edu> <43139A27.6050609@ee.byu.edu> Message-ID: <1125450085.431501651d7ef@webmail.bard.edu> Quoting Travis Oliphant : [snip] > res = stats.norm.fit(data) > > res would be just the location and scale parameters since there are no > shape parameters. > > I just tried this and I get an error because of calling conventions to > nnlf. This needs to be fixed. Oh, yes, I see. If I had stared a bit harder at the trace, I might've figured it out myself -- but I was really resisting the idea that fit itself might be broken! OK, I feel better now. Thanks for leading me through. Mark Lindeman From rcsqtc at iiqab.csic.es Wed Aug 31 06:24:49 2005 From: rcsqtc at iiqab.csic.es (Ramon Crehuet) Date: Wed, 31 Aug 2005 12:24:49 +0200 Subject: [SciPy-user] scipy.test() fail Message-ID: <43158571.70604@iiqab.csic.es> Dear all, I have downloaded and installed Scipy but I get a problem running the tests. After a long output I get: >>>import scipy >>>scipy.test() . . . Don't worry about a warning regarding the number of bytes read. Warning: 1000000 bytes requested, 20 bytes read. .........................................................................................................................................../usr/lib/python2.3/site-packages/scipy/interpolate/fitpack2.py:412: UserWarning: The coefficients of the spline returned have been computed as the minimal norm least-squares solution of a (numerically) rank deficient system (deficiency=7). If deficiency is large, the results may be inaccurate. Deficiency may strongly depend on the value of eps. warnings.warn(message) ...................Illegal instruction And I am returned to the shell. This is the output from system_info.py _pkg_config_info: NOT AVAILABLE agg2_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE atlas_blas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/ATLAS ) ( paths: /usr/lib/libf77blas.a ) ( paths: /usr/lib/libcblas.a ) ( paths: /usr/lib/libatlas.a ) ( paths: /usr/lib/ATLAS ) system_info.atlas_blas_info ( include_dirs = /usr/local/include:/usr/include ) FOUND: libraries = ['f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/lib'] language = c atlas_blas_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/ATLAS ) ( paths: /usr/lib/libatlas.a ) system_info.atlas_blas_threads_info NOT AVAILABLE atlas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/ATLAS ) ( paths: /usr/lib/libf77blas.a ) ( paths: /usr/lib/libcblas.a ) ( paths: /usr/lib/libatlas.a ) ( paths: /usr/lib/ATLAS ) ( paths: /usr/lib/liblapack.so ) system_info.atlas_info ( include_dirs = /usr/local/include:/usr/include ) FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/lib'] language = f77 atlas_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/ATLAS ) ( paths: /usr/lib/libatlas.a ) system_info.atlas_threads_info NOT AVAILABLE blas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/libblas.so ) FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] language = f77 blas_opt_info: running build_src building extension "atlas_version" sources creating build creating build/src adding 'build/src/atlas_version_0x375d48b1.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext building 'atlas_version' extension compiling C sources gcc options: '-pthread -fno-strict-aliasing -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -g -fPIC' creating build/temp.linux-i686-2.3 creating build/temp.linux-i686-2.3/build creating build/temp.linux-i686-2.3/build/src compile options: '-I/usr/include/python2.3 -c' gcc: build/src/atlas_version_0x375d48b1.c gcc -pthread -shared build/temp.linux-i686-2.3/build/src/atlas_version_0x375d48b1.o -L/usr/lib -latlas -o build/temp.linux-i686-2.3/atlas_version.so /usr/lib/python2.3/site-packages/scipy_distutils/system_info.py:812: FutureWarning: hex()/oct() of negative int will return a signed string in Python 2.4 and up magic = hex(hash(`config`)) FOUND: libraries = ['f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/lib'] language = c define_macros = [('ATLAS_INFO', '"\\"3.6.0\\""')] blas_src_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE boost_python_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE dfftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE dfftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE djbfft_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE fftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE fftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE freetype2_info: NOT AVAILABLE gdk_2_info: FOUND: libraries = ['gdk-x11-2.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_2_INFO', '"\\"2.2.4\\""'), ('GDK_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_info: FOUND: libraries = ['gdk', 'Xi', 'Xext', 'X11', 'm', 'glib'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('GDK_INFO', '"\\"1.2.10\\""'), ('GDK_VERSION_1_2_10', None)] include_dirs = ['/usr/include/gtk-1.2', '/usr/X11R6/include', '/usr/include/glib-1.2', '/usr/lib/glib/include'] gdk_pixbuf_2_info: FOUND: libraries = ['gdk_pixbuf-2.0', 'm', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_PIXBUF_2_INFO', '"\\"2.2.4\\""'), ('GDK_PIXBUF_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_pixbuf_xlib_2_info: FOUND: libraries = ['gdk_pixbuf_xlib-2.0', 'gdk_pixbuf-2.0', 'm', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_PIXBUF_XLIB_2_INFO', '"\\"2.2.4\\""'), ('GDK_PIXBUF_XLIB_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_x11_2_info: FOUND: libraries = ['gdk-x11-2.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_X11_2_INFO', '"\\"2.2.4\\""'), ('GDK_X11_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gtkp_2_info: FOUND: libraries = ['gtk-x11-2.0', 'gdk-x11-2.0', 'atk-1.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GTKP_2_INFO', '"\\"2.2.4\\""'), ('GTK_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/atk-1.0', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gtkp_x11_2_info: FOUND: libraries = ['gtk-x11-2.0', 'gdk-x11-2.0', 'atk-1.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GTKP_X11_2_INFO', '"\\"2.2.4\\""'), ('GTK_X11_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/atk-1.0', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] lapack_atlas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/ATLAS ) ( paths: /usr/lib/libf77blas.a ) ( paths: /usr/lib/libcblas.a ) ( paths: /usr/lib/libatlas.a ) system_info.lapack_atlas_info NOT AVAILABLE lapack_atlas_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/ATLAS ) ( paths: /usr/lib/libatlas.a ) system_info.lapack_atlas_threads_info NOT AVAILABLE lapack_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/liblapack.so ) FOUND: libraries = ['lapack'] library_dirs = ['/usr/lib'] language = f77 lapack_opt_info: running build_src building extension "atlas_version" sources adding 'build/src/atlas_version_0xf2e16eb0.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext customize GnuFCompiler customize GnuFCompiler customize GnuFCompiler using build_ext FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/lib'] language = f77 define_macros = [('ATLAS_INFO', '"\\"3.6.0\\""')] lapack_src_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE numarray_info: NOT AVAILABLE numpy_info: ( include_dirs = /usr/include/python2.3 ) ( paths: /usr/include/python2.3/Numeric/arrayobject.h ) FOUND: define_macros = [('NUMERIC_VERSION', '"\\"23.8\\""')] include_dirs = ['/usr/include/python2.3'] sfftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE sfftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE wx_info: FOUND: libraries = ['wx_gtk2-2.4'] extra_link_args = ['-pthread'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('WX_INFO', '"\\"2.4.2\\""'), ('WX_VERSION_2_4_2', None), ('WX_RELEASE_2_4', None), ('GTK_NO_CHECK_CASTS', None), ('__WXGTK__', None), ('_FILE_OFFSET_BITS', '64'), ('_LARGE_FILES', None)] include_dirs = ['/usr/lib/wx/include/gtk2-2.4'] x11_info: ( library_dirs = /usr/X11R6/lib:/usr/lib ) ( include_dirs = /usr/X11R6/include:/usr/include ) ( paths: /usr/X11R6/lib/libX11.so ) ( paths: /usr/X11R6/include/X11/X.h ) FOUND: libraries = ['X11'] library_dirs = ['/usr/X11R6/lib'] include_dirs = ['/usr/X11R6/include'] xft_info: FOUND: libraries = ['Xft', 'X11', 'freetype', 'Xrender', 'fontconfig'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('XFT_INFO', '"\\"2.1.2\\""'), ('XFT_VERSION_2_1_2', None)] include_dirs = ['/usr/X11R6/include', '/usr/include/freetype2'] Does anybody have an idea of what is going on? Thanks, Ramon From noel.oboyle2 at mail.dcu.ie Wed Aug 31 06:37:35 2005 From: noel.oboyle2 at mail.dcu.ie (Noel O'Boyle) Date: Wed, 31 Aug 2005 11:37:35 +0100 Subject: [SciPy-user] getting the "best" two eigenvectors for a PCA analysis with a power method In-Reply-To: <20050829072328.GA5148@itb.biologie.hu-berlin.de> References: <20050829072328.GA5148@itb.biologie.hu-berlin.de> Message-ID: <1125484655.4251.97.camel@sandwi.ch.cam.ac.uk> R calculates the PCs using singular value decomposition, instead of using the eigenvalues of the covariance matrix. From the R manual for prcomp: "The calculation is done by a singular value decomposition of the (centered and possibly scaled) data matrix, not by using 'eigen' on the covariance matrix. This is generally the preferred method for numerical accuracy." (1) Can anyone comment on what numerical accuracy means in this context, and whether one should really care about this for principal component analysis? Regards, Noel O'Boyle. On Mon, 2005-08-29 at 09:23 +0200, Tiziano Zito wrote: > On Fri 26 Aug, 18:46, Syd Diamond wrote: > > I'll be honest -- I'm mostly interested in the end not the means right > > now. I need to find the first and second principal components of a > > 120x520 matrix. > > The package 'MDP' http://mdp-toolkit.sourceforge.net together with > 'symeig' http://mdp-toolkit.sourceforge.net/symeig.html offers taht > functionality (and much more). Note that results are much faster > than standard eigenvalue problem solution with scipy.linalg.eig. > After installing MDP and symeig you can simply do: > > >>> import mdp > >>> out = mdp.pca(input_data, output_dim = 2) > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From rkern at ucsd.edu Wed Aug 31 10:40:41 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 31 Aug 2005 07:40:41 -0700 Subject: [SciPy-user] getting the "best" two eigenvectors for a PCA analysis with a power method In-Reply-To: <1125484655.4251.97.camel@sandwi.ch.cam.ac.uk> References: <20050829072328.GA5148@itb.biologie.hu-berlin.de> <1125484655.4251.97.camel@sandwi.ch.cam.ac.uk> Message-ID: <4315C169.7060301@ucsd.edu> Noel O'Boyle wrote: > R calculates the PCs using singular value decomposition, instead of > using the eigenvalues of the covariance matrix. From the R manual for > prcomp: > > "The calculation is done by a singular value decomposition of the > (centered and possibly scaled) data matrix, not by using 'eigen' > on the covariance matrix. This is generally the preferred method > for numerical accuracy." > > (1) Can anyone comment on what numerical accuracy means in this context, > and whether one should really care about this for principal component > analysis? Forming the covariance matrix necessarily involves more floating point operations in which error accumulates (not to mention an unnecessary division). It may also yield a covariance matrix whose elements have very large differences in magnitude (indeed, that's essentially the entire point of PCA), but ideally you want to push that occurrence as late as possible in the process. Yes, you should probably care. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From rcsqtc at iiqab.csic.es Wed Aug 31 11:08:50 2005 From: rcsqtc at iiqab.csic.es (Ramon Crehuet) Date: Wed, 31 Aug 2005 17:08:50 +0200 Subject: [SciPy-user] scipy.test() fail Message-ID: <4315C802.50001@iiqab.csic.es> Dear all, I sent a message a couple of hours ago saying that I got a message with Scipy tests. I recompiles BLAS, LAPACK, ATLAS and Numeric and now everything works fine. I'm looking forward to use this great code! Ramon From oliphant at ee.byu.edu Wed Aug 31 12:34:31 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Wed, 31 Aug 2005 10:34:31 -0600 Subject: [SciPy-user] scipy.test() fail In-Reply-To: <43158571.70604@iiqab.csic.es> References: <43158571.70604@iiqab.csic.es> Message-ID: <4315DC17.5050707@ee.byu.edu> Ramon Crehuet wrote: > Dear all, > I have downloaded and installed Scipy but I get a problem running > the tests. After a long output I get: > > >>>import scipy > >>>scipy.test() > . > . > . > Don't worry about a warning regarding the number of bytes read. > Warning: 1000000 bytes requested, 20 bytes read. > .........................................................................................................................................../usr/lib/python2.3/site-packages/scipy/interpolate/fitpack2.py:412: > UserWarning: > The coefficients of the spline returned have been computed as the > minimal norm least-squares solution of a (numerically) rank deficient > system (deficiency=7). If deficiency is large, the results may be > inaccurate. Deficiency may strongly depend on the value of eps. > warnings.warn(message) > ...................Illegal instruction This looks like an ATLAS bug to me. I've seen issues like this crop up for me, too. I have to disable the tests for the bad ATLAS routines. -Travis From rainman.rocks at gmail.com Wed Aug 31 16:18:07 2005 From: rainman.rocks at gmail.com (rainman) Date: Thu, 1 Sep 2005 00:18:07 +0400 Subject: [SciPy-user] python crashes on scipy testing Message-ID: <1326237074.20050901001807@gmail.com> Hello scipy-user, God, that's one thing I hate about Open Source - having to hunt high and low for binaries... or to face tremendous nightmares of building-from-sources. Let's see. I'm running WinXP on A-64. I have Python 2.4. Some time ago I decided to try SciPy. Aw, hell! No prebuilt binaries for Py2.4. And you need a ton of compilers to "make" sources. But I'm stubborn. I had nerve. I took: MSYS-1.0.10.exe MinGW-3.1.0-1.exe atlas3.6.0_WinNT_PIII.zip SciPy_complete-0.3.2.tar.gz Numeric-23.8.win32-py2.4.exe F2PY-2-latest.win32.exe , then I tuned environment vars and started "setup.py build". Oh! how cute! they forgot to put wgnuplot.exe inside! Let's take it from SciPy_complete-0.3.2.win32-py2.3-num23.5.exe. Trying once more... Tada! Compilation finally finished without error message. Let's run: import scipy scipy.test() Yeah, a lot of "no test file" messages, dots, some cryptic mumbling ending with "zswap:n=3", more dots, WHOOPS! python crashes. So, the question is... WHAT ELSE??? -- Best regards, rainman mailto:rainman.rocks at gmail.com From seefeld at sympatico.ca Wed Aug 31 16:32:21 2005 From: seefeld at sympatico.ca (Stefan Seefeld) Date: Wed, 31 Aug 2005 16:32:21 -0400 Subject: [SciPy-user] python crashes on scipy testing In-Reply-To: <1326237074.20050901001807@gmail.com> References: <1326237074.20050901001807@gmail.com> Message-ID: <431613D5.6090707@sympatico.ca> rainman wrote: > Hello scipy-user, > > God, that's one thing I hate about Open Source - having to hunt high > and low for binaries... or to face tremendous nightmares of > building-from-sources. May be if you wave (loud enough) with a check someone will step up with a binary ? sarcastically-your's Stefan From rkern at ucsd.edu Wed Aug 31 16:43:41 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 31 Aug 2005 13:43:41 -0700 Subject: [SciPy-user] python crashes on scipy testing In-Reply-To: <1326237074.20050901001807@gmail.com> References: <1326237074.20050901001807@gmail.com> Message-ID: <4316167D.2050004@ucsd.edu> rainman wrote: > Hello scipy-user, > > God, that's one thing I hate about Open Source - having to hunt high > and low for binaries... or to face tremendous nightmares of > building-from-sources. > > Let's see. I'm running WinXP on A-64. I have Python 2.4. Some time ago > I decided to try SciPy. Aw, hell! No prebuilt binaries for Py2.4. > And you need a ton of compilers to "make" sources. > > But I'm stubborn. I had nerve. I took: > > MSYS-1.0.10.exe > MinGW-3.1.0-1.exe > atlas3.6.0_WinNT_PIII.zip > SciPy_complete-0.3.2.tar.gz > Numeric-23.8.win32-py2.4.exe > F2PY-2-latest.win32.exe > > , then I tuned environment vars and started "setup.py build". > > Oh! how cute! they forgot to put wgnuplot.exe inside! Let's take it > from SciPy_complete-0.3.2.win32-py2.3-num23.5.exe. Trying once more... > > Tada! Compilation finally finished without error message. > Let's run: > > import scipy > scipy.test() > > Yeah, a lot of "no test file" messages, dots, some cryptic mumbling > ending with "zswap:n=3", more dots, WHOOPS! python crashes. > > So, the question is... WHAT ELSE??? First, take a breath and try to relax. I know you're frustrated, but being rude to the people you are asking help from isn't helping you get your problems fixed. Second, use scipy.test(verbosity=2) and give us the appropriate part of the output (just the tail end before it crashes). Third, you may also want to try the latest snapshot of the development sources. 0.3.2 is quite old. http://ipython.scipy.org/tmp/scipy_cvs_2005-07-29.tgz It's probably a problem with ATLAS since you are on an Athlon 64 processor and using Pentium-III binaries (and ATLAS is rather more sensitive to the CPU than any other part of scipy). So fourth, you may want to compile ATLAS from source, too. You can get the source package from http://math-atlas.sourceforge.net/ If you succeed in doing so, we would be interested in putting the resulting binaries on the web site in order to save others using Athlon 64 chips the effort and frustration. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From oliphant at ee.byu.edu Wed Aug 31 16:46:35 2005 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Wed, 31 Aug 2005 14:46:35 -0600 Subject: [SciPy-user] python crashes on scipy testing In-Reply-To: <1326237074.20050901001807@gmail.com> References: <1326237074.20050901001807@gmail.com> Message-ID: <4316172B.7040800@ee.byu.edu> rainman wrote: >Hello scipy-user, > >God, that's one thing I hate about Open Source - having to hunt high >and low for binaries... or to face tremendous nightmares of >building-from-sources. > >Let's see. I'm running WinXP on A-64. I have Python 2.4. Some time ago >I decided to try SciPy. Aw, hell! No prebuilt binaries for Py2.4. >And you need a ton of compilers to "make" sources. > >But I'm stubborn. I had nerve. I took: > >MSYS-1.0.10.exe >MinGW-3.1.0-1.exe >atlas3.6.0_WinNT_PIII.zip >SciPy_complete-0.3.2.tar.gz >Numeric-23.8.win32-py2.4.exe >F2PY-2-latest.win32.exe > >, then I tuned environment vars and started "setup.py build". > >Oh! how cute! they forgot to put wgnuplot.exe inside! Let's take it >from SciPy_complete-0.3.2.win32-py2.3-num23.5.exe. Trying once more... > >Tada! Compilation finally finished without error message. >Let's run: > >import scipy >scipy.test() > >Yeah, a lot of "no test file" messages, dots, some cryptic mumbling >ending with "zswap:n=3", more dots, WHOOPS! python crashes. > > > This is most likely a problem with ATLAS. The rest of scipy will probably work fine. If you don't need that particular ATLAS routine (which in my experience the buggy ATLAS routines are lesser used...) you are good to go. -Travis O. From wjdandreta at att.net Wed Aug 31 21:39:49 2005 From: wjdandreta at att.net (Bill Dandreta) Date: Wed, 31 Aug 2005 21:39:49 -0400 Subject: [SciPy-user] python crashes on scipy testing In-Reply-To: <4316172B.7040800@ee.byu.edu> References: <1326237074.20050901001807@gmail.com> <4316172B.7040800@ee.byu.edu> Message-ID: <43165BE5.6020002@att.net> Travis Oliphant wrote: > This is most likely a problem with ATLAS. The rest of scipy will > probably work fine. If you don't need that particular ATLAS routine > (which in my experience the buggy ATLAS routines are lesser used...) > you are good to go. > Compiling from source with Gentoo is usually a piece of cake. That was not my problem. I don't think ATLAS is the only problem either. I spent the better part of a week trying to get scipy to work with Gentoo Linux64 running on an AMD64 CPU. I finally gave up in frustration and went back to 32 bit. I tried ATLAS 3.6.0, 3.7.10, and the Linux_HAMMER64SSE3 binaries from the ATLAS site. I tried blas/lapack and AMD's ACML libraries. Everything compiles and all tests are OK until the final scipy test that always results in "SEGMENTATION FAULT" no matter what level of verbosity I tried. In spite of the test failing, I tried to use scipy anyway. I ran a script that works fine on 32 bit Linux. The plot routines didn't work correctly. They either plot incorrectly or give an error. I kept the 64 bit installation on my HD and I planned to post the plot errors here but have not had time to get back to it yet. I don't think 64 bit is 'ready for prime time'. I had problems with applications other than scipy. Almost any problem can cause a seg fault instead of printing the application's diagnostic information. That's the primary reason I went back to 32 bit. I was wasting too much time trying to fix problems without having any useful diagnostic information and I wasn't getting any work done. Bill