[Numpy-discussion] Python vector and matrix formatter similar to Matlab

2007-03-09 Thread Simon Wood
To all, I came across an old thread in the archives in which Alexander Schmolck gave an example of a Matlab like matrix formatter he authored for Python. Is this formatter still available some where? Or has anyone else done anything similar? -Simon P.S. Here is a short example of the output: *

Re: [Numpy-discussion] 0/0 is 0 or nan?

2007-03-09 Thread Chris Ball
Thank you both for your replies - the difference is clear to me now. Chris ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] nd_image.affine_transform edge effects

2007-03-09 Thread James Turner
Last year I wrote a program that uses the affine_transform() function in numarray to resample and co-add datacubes with WCS offsets in 3D. This function makes it relatively easy to handle N-D offsets and rotations with a smooth interpolant, which is exactly what I wanted. However, I am finding that

Re: [Numpy-discussion] [PATCH] a fix for compiling numexpr with MSVC Toolkit 2003

2007-03-09 Thread David M. Cooke
On Fri, 9 Mar 2007 16:11:28 + [EMAIL PROTECTED] wrote: > Hi, > > I've done a patch for allowing compiling the last version of numexpr with > the MSVC Toolkit 2003 compiler on Windows platforms. You can fetch it > from: > > http://www.pytables.org/trac/changeset/2514/trunk Checked in. It did

Re: [Numpy-discussion] Variable String Format

2007-03-09 Thread Alan Isaac
lechtlr wrote: >I would very much appreciate, if someone can give suggestions to implement > a loop to generate a string in the following format. > Variables with assigned values are given in A: > A = {a1:2.0, a2:4.0,………,an:5.0} > I want to transform what is in the dictionary in

Re: [Numpy-discussion] Variable String Format

2007-03-09 Thread Pierre GM
On Friday 09 March 2007 14:41:23 lechtlr wrote: >I would very much appreciate, if someone can give suggestions to > implement a loop to generate a string in the following format. Variables > with assigned values are given in A: > A = {a1:2.0, a2:4.0,………,an:5.0} > I want to transform w

Re: [Numpy-discussion] Putting some random back into the top-level?

2007-03-09 Thread Keith Goodman
On 3/9/07, Bill Baxter <[EMAIL PROTECTED]> wrote: > Has enough time passed with no top level random function that we can > now put one back in? > If I recall, the former top level rand() was basically removed because > it didn't adhere to the "shapes are always tuples" convention. Top-level rand f

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 6, Issue 20

2007-03-09 Thread James A. Bednar
| Date: Fri, 9 Mar 2007 06:58:32 -0800 | From: "Sebastian Haase" <[EMAIL PROTECTED]> | Subject: Re: [Numpy-discussion] Numpy-discussion Digest, Vol 6, Issue 18 | To: "Discussion of Numerical Python" | | On 3/9/07, James A. Bednar <[EMAIL PROTECTED]> wrote: | > | From: Robert Kern <[EMAIL

[Numpy-discussion] Putting some random back into the top-level?

2007-03-09 Thread Bill Baxter
Has enough time passed with no top level random function that we can now put one back in? If I recall, the former top level rand() was basically removed because it didn't adhere to the "shapes are always tuples" convention. Has enough time passed now that we can put something like it back in the t

Re: [Numpy-discussion] Variable String Format

2007-03-09 Thread Bill Baxter
str(A)[1:-1] ? --bb On 3/10/07, lechtlr <[EMAIL PROTECTED]> wrote: I would very much appreciate, if someone can give suggestions to implement a loop to generate a string in the following format. Variables with assigned values are given in A: A = {a1:2.0, a2:4.0,………,an:5.0} I want to transf

Re: [Numpy-discussion] 0/0 is 0 or nan?

2007-03-09 Thread Christopher Barker
Robert Kern wrote: > What version of numpy are you using? >>> from numpy import * >>> print __version__ 1.0.1 >>> a = array(0, dtype=int) >>> b = array(0, dtype=int) >>> divide(a, b) Warning: divide by zero encountered in divide 0 >>> geterr() {'over': 'print', 'divide': 'print', 'invalid': '

[Numpy-discussion] Variable String Format

2007-03-09 Thread lechtlr
I would very much appreciate, if someone can give suggestions to implement a loop to generate a string in the following format. Variables with assigned values are given in A: A = {a1:2.0, a2:4.0,………,an:5.0} I want to transform what is in the dictionary into a string in the follo

Re: [Numpy-discussion] in place random generation

2007-03-09 Thread Matthew Brett
Oh dear, sorry, I should have read your email more carefully. Matthew On 3/8/07, Daniel Mahler <[EMAIL PROTECTED]> wrote: > On 3/8/07, Matthew Brett <[EMAIL PROTECTED]> wrote: > > > > My problem is not space, but time. > > > > I am creating a small array over and over, > > > > and this is turning

Re: [Numpy-discussion] in place random generation

2007-03-09 Thread Robert Kern
Anne Archibald wrote: > On 09/03/07, Robert Kern <[EMAIL PROTECTED]> wrote: >> Mark P. Miller wrote: >>> As an aside, are the random number generators from scipy.random the same >>> as those for numpy.random? If not, will those of us who need to just >>> use a few random numbers here and there thr

[Numpy-discussion] ANN: PyTables 2.0 beta1 released

2007-03-09 Thread Francesc Altet
= Announcing PyTables 2.0b1 = The PyTables development team is very happy to announce the public availability of the first *beta* version of PyTables 2.0. Starting with this release, both the API and the file format have entered in the stage of fre

Re: [Numpy-discussion] in place random generation

2007-03-09 Thread Robert Kern
Mark P. Miller wrote: > Robert Kern wrote: > > scipy.random is not a package. scipy/__init__.py does a "from numpy > import *" > > and thus pulls in numpy.random. > > Got it...and one more question: > > What about using something like > from numpy.random import mtrand > > And then using mtran

Re: [Numpy-discussion] in place random generation

2007-03-09 Thread Mark P. Miller
Robert Kern wrote: > scipy.random is not a package. scipy/__init__.py does a "from numpy import *" > and thus pulls in numpy.random. > Got it...and one more question: What about using something like from numpy.random import mtrand And then using mtrand.seed and mtrand.normal in code? Would

Re: [Numpy-discussion] in place random generation

2007-03-09 Thread Anne Archibald
On 09/03/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Mark P. Miller wrote: > > As an aside, are the random number generators from scipy.random the same > > as those for numpy.random? If not, will those of us who need to just > > use a few random numbers here and there throughout our code (we don'

Re: [Numpy-discussion] 0/0 is 0 or nan?

2007-03-09 Thread Robert Kern
Christopher Barker wrote: > Robert Kern wrote: >> However, I believe that divide() on two Python ints goes through a different >> path than for numpy arrays and numpy scalars. Rather, they are recognized as >> objects that implement .__div__(), and that is called instead. > > Then wouldn't this be

Re: [Numpy-discussion] in place random generation

2007-03-09 Thread Robert Kern
Mark P. Miller wrote: > As an aside, are the random number generators from scipy.random the same > as those for numpy.random? If not, will those of us who need to just > use a few random numbers here and there throughout our code (we don't > need arrays of random numbers or broadcasting abiliti

Re: [Numpy-discussion] Which dtype are supported by numexpr ?

2007-03-09 Thread Francesc Altet
A Divendres 09 Març 2007 18:40, Sebastian Haase escrigué: > Hi ! > This is really only one question: > > Which dtypes are supported by numexpr ? Well, numexpr does support any dtype that is homogeneous, except 'uint64'. This is because internally all the unsigned types are upcasted to the smalle

[Numpy-discussion] Which dtype are supported by numexpr ?

2007-03-09 Thread Sebastian Haase
Hi ! This is really only one question: Which dtypes are supported by numexpr ? We are very interested in numexpr ! Where is the latest / most-up-to-date documentation ? Thanks, Sebastian Haase ___ Numpy-discussion mailing list Numpy-discussion@scipy.or

Re: [Numpy-discussion] 0/0 is 0 or nan?

2007-03-09 Thread Christopher Barker
Robert Kern wrote: > However, I believe that divide() on two Python ints goes through a different > path than for numpy arrays and numpy scalars. Rather, they are recognized as > objects that implement .__div__(), and that is called instead. Then wouldn't this be different: >>> a = N.array(0, dt

Re: [Numpy-discussion] in place random generation

2007-03-09 Thread Mark P. Miller
This discussion has much in common with a previous thread that I started ("When and where to use Numpy..."). I fully admit to being a naive numpy user, but it seems to me that it would be helpful if the documentation provided some explicit statements to inform potential users about the best typ

[Numpy-discussion] [PATCH] a fix for compiling numexpr with MSVC Toolkit 2003

2007-03-09 Thread faltet
Hi, I've done a patch for allowing compiling the last version of numexpr with the MSVC Toolkit 2003 compiler on Windows platforms. You can fetch it from: http://www.pytables.org/trac/changeset/2514/trunk BTW, I understand now why Tim Hochberg was so worried about the time that it takes to compil

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 6, Issue 18

2007-03-09 Thread Sebastian Haase
On 3/9/07, James A. Bednar <[EMAIL PROTECTED]> wrote: > | From: Robert Kern <[EMAIL PROTECTED]> > | Subject: Re: [Numpy-discussion] in place random generation > | > | Daniel Mahler wrote: > | > On 3/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote: > | > | >> Robert thought this might relate t

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 6, Issue 18

2007-03-09 Thread James A. Bednar
| From: Robert Kern <[EMAIL PROTECTED]> | Subject: Re: [Numpy-discussion] in place random generation | | Daniel Mahler wrote: | > On 3/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote: | | >> Robert thought this might relate to Travis' changes adding | >> broadcasting to the random number

Re: [Numpy-discussion] Conservative order in .argsort

2007-03-09 Thread Berthold Höllmann
Robert Kern <[EMAIL PROTECTED]> writes: > Berthold Höllmann wrote: > >> My question is, is "kind='merge'" sorting garanteed to be conservative? > > Yes, such a sort is called "stable" (at least in US computer science) and is > documented in the docstring. I looked in the numpy book, but this info

Re: [Numpy-discussion] Conservative order in .argsort

2007-03-09 Thread Robert Kern
Berthold Höllmann wrote: > My question is, is "kind='merge'" sorting garanteed to be conservative? Yes, such a sort is called "stable" (at least in US computer science) and is documented in the docstring. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enig

Re: [Numpy-discussion] In need of Bessel functions - cephes/amos bindings for new numpy?

2007-03-09 Thread Nils Wagner
Arnd Baecker wrote: > On Fri, 9 Mar 2007, Gregory Lielens wrote: > > >> Hi, >> we are looking for Bessel/Hankel ufuncs, and naturally found the cephes >> module developed by Travis. Had a quick look, and it seems the latest >> version I found (cepehs-1.3) is quite old, targeted to python 1.5 an

Re: [Numpy-discussion] In need of Bessel functions - cephes/amos bindings for new numpy?

2007-03-09 Thread Arnd Baecker
On Fri, 9 Mar 2007, Gregory Lielens wrote: > Hi, > we are looking for Bessel/Hankel ufuncs, and naturally found the cephes > module developed by Travis. Had a quick look, and it seems the latest > version I found (cepehs-1.3) is quite old, targeted to python 1.5 and > numerics. Questions and disc

[Numpy-discussion] In need of Bessel functions - cephes/amos bindings for new numpy?

2007-03-09 Thread Gregory Lielens
Hi, we are looking for Bessel/Hankel ufuncs, and naturally found the cephes module developed by Travis. Had a quick look, and it seems the latest version I found (cepehs-1.3) is quite old, targeted to python 1.5 and numerics. Questions and discussions about it on newsgroup seems to have died o

[Numpy-discussion] Conservative order in .argsort

2007-03-09 Thread Berthold Höllmann
In our process of switching from Numeric to numpy we had a problem with a function using argsort. The function expected a conservative order of the argsort result but we got: >>> import numpy >>> numpy.argsort(numpy.ones(16, dtype=numpy.dtype('float64'))) array([ 0, 1, 2, 3, 4, 5, 6, 7, 8,