Re: [Numpy-discussion] Random number generators

2006-09-03 Thread A. M. Archibald
found another pseudorandom number generator that I could just switch to a benefit; the rest of them are less exciting. When you say 32-bit integers do you really mean 32-bit, or do you mean machine width? 32-bit integers may not be faster on 64-bit platforms... A. M. Archibald

Re: [Numpy-discussion] diagflat

2006-09-03 Thread A. M. Archibald
indexing wizardry. A. M. Archibald from numpy import zeros, shape, newaxis, repeat, where, indices, asarray import sys def todiagonal(A,axis=-1): A = asarray(A) s = shape(A) if axis0: axis += len(s) if not 0=axislen(s): raise IndexError, Axis out of range # Concoct an index

Re: [Numpy-discussion] Random number generators

2006-09-04 Thread A. M. Archibald
On 04/09/06, Robert Kern [EMAIL PROTECTED] wrote: A. M. Archibald wrote: In the same project I also noticed it would be nice to be able to (say) do exponential(2+sin(arange(10))) to get an array of exponentials with varying parameters. Travis O. recently added this capability

Re: [Numpy-discussion] Random number generators

2006-09-04 Thread A. M. Archibald
depending on the implementation). Are 32-bit numbers really the right least common denominator? There are plenty of 64-bit platforms out there... Given this API, implementing a subclassable class that exports it should satisfy most people's needs for interchangeable generators. A. M. Archibald

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread A. M. Archibald
are always logically C-ordered even if the underlying representation is different. Does it make sense to specify this somewhere in the docstring? At least it would be good to make it clear that the order parameter affects only the underlying storage format, and not the indexing of the array. A. M. Archibald

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread A. M. Archibald
code will actually break? A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere

Re: [Numpy-discussion] visual programming

2006-09-18 Thread A. M. Archibald
towards music, audio signal processing, 2D and 3D video. (They're related to Max and jMax, which do some of the same things.) A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread A. M. Archibald
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote: A. M. Archibald wrote: Mmm. Somebody who's working with NaNs has more or less already decided they don't want to be pestered with exceptions for invalid data. Do you really think so? In my experience NaNs are nearly always just

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread A. M. Archibald
returning arrays in which the non-NaNs are unsorted, is really bad. A. M. Archibald - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread A. M. Archibald
flags, which would be extremely useful to have, and which are being wored on, IIRC. A. M. Archibald - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread A. M. Archibald
only if there are any NaNs (also, you can't use == for NaNs, you have to use C isNaN). But I'm starting to see the wisdom in simply throwing an exception, since sorting is not well-defined with NaNs. A. M. Archibald - Take

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread A. M. Archibald
is reshuffled requires a lot of work and isn't particularly better. I mostly presented it as an alternative to throwing an exception. Throwing a Python exception now seems like the most reasonable idea. A. M. Archibald - Take

Re: [Numpy-discussion] eval shortcomings?

2006-09-24 Thread A. M. Archibald
that the interpretor does that eval doesn't do? No. Eval evaluates expressions, that is, formulas producing a value. a=b does not produce a value, so you are obtaining the same error you would if you'd written if a=b: ... The way you run code that doesn't return a value is with exec. A. M

Re: [Numpy-discussion] Vectorizing code, for loops, and all that

2006-10-03 Thread A. M. Archibald
). More generally, all the tricks that ATLAS uses to accelerate BLAS routines would (in principle) be applicable here. The implementation would be extremely difficult, though, even if all the basic loops could be expressed in a few primitives. A. M. Archibald

Re: [Numpy-discussion] Manually broadcasting arrays in Python

2006-10-03 Thread A. M. Archibald
(lambda *args: args)? Almost works, only it sometimes segfaults with more than two arguments... but that's clearly a numpy bug. A. M. Archibald - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay

Re: [Numpy-discussion] Hello and my first patch

2006-10-05 Thread A. M. Archibald
involved. A. M. Archibald - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn

Re: [Numpy-discussion] Hello and my first patch

2006-10-05 Thread A. M. Archibald
://www.scipy.org/Numpy_Example_List ) are a good start. A. M. Archibald - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics

Re: [Numpy-discussion] can this be made faster?

2006-10-08 Thread A. M. Archibald
slower than fancy indexing, so the way to do this one is just to use a for loop. A. M. Archibald - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your

Re: [Numpy-discussion] can this be made faster?

2006-10-09 Thread A. M. Archibald
(for cache coherency in a) This seems like a rather common operation - I know I've needed it on at least two occasions - is it worth creating some sort of C implementation? What is the appropriate generalization? A. M. Archibald

Re: [Numpy-discussion] can this be made faster?

2006-10-09 Thread A. M. Archibald
time an index comes up we want to add the value to what's there, rather than replacing it. I suppose histogram covers one major application; in fact if histogram allowed weightings (count this point as -0.6) it would solve the OP's problem. A. M. Archibald

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread A. M. Archibald
? (cough, Numeric compatibility, cough) Would it be of interest to have numeric datatypes integrated with python datatypes? How about IEEE floats in python proper, at least? It can be rather confusing when doing a calculation yields different results for arrays than for ordinary scalars... A. M

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread A. M. Archibald
hasn't been released yet... A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere

Re: [Numpy-discussion] Polyfit

2006-10-13 Thread A. M. Archibald
of polynomials - X^n, (X-a)^n, orthogonal polynomials (translated and scaled as needed), what have you. I think I vote for polyfit that is no more clever than it has to be but which warns the user when the fit is bad. A. M. Archibald

Re: [Numpy-discussion] Polyfit

2006-10-13 Thread A. M. Archibald
to numerical instabilities. In any case, all this is outside the purview of numpy (as is polyfit, frankly). A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly

Re: [Numpy-discussion] [SciPy-dev] NumPy/SciPy + MPI for Python

2006-10-14 Thread A. M. Archibald
), as is Scientific Python (and numpy, Numeric and numarray are obviously already confusing). A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology

Re: [Numpy-discussion] rcond in polyfit

2006-10-14 Thread A. M. Archibald
On 14/10/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/13/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 13/10/06, Tim Hochberg [EMAIL PROTECTED] wrote: Charles R Harris wrote: snip On the other hand if error handling is set to 'raise', then a FloatingPointError is issued

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread A. M. Archibald
want. A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-18 Thread A. M. Archibald
On 18/10/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/17/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 17/10/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/17/06, Travis Oliphant [EMAIL PROTECTED] wrote: Thus, reshape does the equivalent of a Fortran ravel

Re: [Numpy-discussion] questions regarding assignement and copy

2006-10-18 Thread A. M. Archibald
python's in-place operators: M += 1 M *= 2 This is actually a standard difficulty people have with python, made more obvious because you're working with mutable arrays rather than immutable scalars. A. M. Archibald - Using

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-20 Thread A. M. Archibald
copies in PyArray_NewShape unless absolutely necessary. A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier

Re: [Numpy-discussion] Model and experiment fitting.

2006-10-20 Thread A. M. Archibald
-dimensional distributions differ? at http://www.nrbook.com/a/bookcpdf.html is one) but it's not clear how to turn the problem you describe into a solvable one - some assumption about how the models vary between sampled x values appears to be necessary, and that amounts to interpolation. A. M. Archibald

Re: [Numpy-discussion] memory position of numpy arrays

2006-10-24 Thread A. M. Archibald
memory is accessed. (In C, I'm afraid, but for this sort of thing C is well-suited.) A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated

[Numpy-discussion] vectorize pitfall

2006-10-25 Thread A. M. Archibald
the correct behaviour... A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application

Re: [Numpy-discussion] vectorize pitfall

2006-10-25 Thread A. M. Archibald
On 25/10/06, Travis Oliphant [EMAIL PROTECTED] wrote: It takes old type-codes as one big string so you say vectorize(f,otypes='d') This should be modernized to handle a list of dtype objects. I've fixed vectorize in SVN. Thanks! A. M. Archibald

Re: [Numpy-discussion] Sorting eigenvalues and vectors together

2006-10-27 Thread A. M. Archibald
. Is there a function that will sort the values and vectors together or do I need to write it myself. I think that they are sorted, but argsort() will do what you want (or argmax(), even). A. M. Archibald - Using Tomcat but need

Re: [Numpy-discussion] Need more comments from scientific community on python-dev

2006-11-01 Thread A. M. Archibald
it take to rewrite numpy to use ctypes? There seems to be some problem with extending the type objects used by ctypes, but it's not very clear to me what that problem is (what the extensions are supposed to do). The argument that *some* datatypes format should become standard is much easier. A. M

Re: [Numpy-discussion] Compressed index sets, generators and iterators

2006-11-01 Thread A. M. Archibald
, A[list(xrange(0,40)] should work fine) isn't necessarily worth the trouble. A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology

Re: [Numpy-discussion] numarray indexing problems with Python2.5 and 64-bit platforms

2006-11-02 Thread A. M. Archibald
problematic to us. Someone has to say it: you could just drop support for the obsolete numarray and provide only support for its successor, numpy. A. M. Archibald - Using Tomcat but need to do more? Need to support web services

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-08 Thread A. M. Archibald
MaskedScalar). If you've got floating point, you can again fill in NaNs, but you have a good point about wanting to extract the original values that were masked out. Depending on what one is doing, one might want one or the other. A. M. Archibald

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-08 Thread A. M. Archibald
discrimination against a citizen in good standing of the IEEE floating point community. A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-09 Thread A. M. Archibald
controllable IEEE floats and MaskedArray, and I apologize for a basically off-topic post. A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated

Re: [Numpy-discussion] sparse SVD

2006-11-11 Thread A. M. Archibald
them to the scipy list - it's always good to build up the library. A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your

Re: [Numpy-discussion] x.min() depends on ordering

2006-11-11 Thread A. M. Archibald
behaviour by taking inf as the initial value for min and -inf as the first value for max, then reducing as normal. This would then, depending on how max and min are implemented, either return NaN if any are present, or return the smallest/largest non-NaN value (or inf/-inf if there are none) A. M

Re: [Numpy-discussion] Could numpy.matlib.nanmax return a matrix?

2006-11-12 Thread A. M. Archibald
On 12/11/06, Keith Goodman [EMAIL PROTECTED] wrote: Is anybody interested in making x.max() and nanmax() behave the same for matrices, except for the NaN part? That is, make numpy.matlib.nanmax return a matrix instead of an array. Sounds good to me; maybe put a patch in the tracker? A. M

Re: [Numpy-discussion] array from list of lists

2006-11-12 Thread A. M. Archibald
-precision floating-point format (if one is available on your machine) before transposing and storing in a record array. A. M. Archibald - Using Tomcat but need to do more? Need to support web services, security? Get stuff done