Re: [Numpy-discussion] Should non ufunc numpy functions behave like ufunc regarding casting to output argument ?

2007-01-15 Thread A. M. Archibald
We do raise an error on shape mismatch; type mismatches are used to forcibly cast the result - which is useful! So I'd say we take it seriously. It's one of the ways to make your code run faster. A. M. Archibald ___ Numpy-discussion mail

Re: [Numpy-discussion] Should non ufunc numpy functions behave like ufunc regarding casting to output argument ?

2007-01-15 Thread A. M. Archibald
the name "b"). for example: a = numpy.arange(10) b = numpy.zeros(40).astype(numpy.uint8) a.clip(0.1,5.2,b[::4]) You can't do anything about the data type of b, so you don't really have any choice but to convert to uint8; one hopes that this will not require the allocation of an

Re: [Numpy-discussion] Fwd: Advanced selection, duplicate indices, and augmented assignment

2007-01-10 Thread A. M. Archibald
because a reshape (and possible copy) is not terribly offensive, and partly because it would make the calling convention (more) confusing. I am not seriously suggesting this implementation for use, but for consideration; if people find the primitive does what they want, one could reasonably simply

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-10 Thread A. M. Archibald
problems - just toss it in with the zillion other C functions in numpy. Perverse as it sounds, f2py might actually set things up rather tidily, leaving a FORTRAN function of a handful of lines; even the data type switching could be done in python. A. M. Archibald ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Fwd: Advanced selection, duplicate indices, and augmented assignment

2007-01-06 Thread A. M. Archibald
he histogram functions are capable of efficiently doing the most common things one might want this for. A. M. Archibald A. M. Archibald ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] custom accumlators

2007-01-05 Thread A. M. Archibald
e effectively a ufunc, supporting all the various operations we might want from a ufunc (albeit inefficiently). This should not be difficult, but I am not up to writing it this evening. A. M. Archibald ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] The risks of empty()

2007-01-02 Thread A. M. Archibald
nsure that array data is > initialised before using it? It does not seem to be a problem in practice, but there are tools to help with what you want to do. A. M. Archibald ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Newbie Question, Probability

2006-12-21 Thread A. M. Archibald
On 21/12/06, Alan G Isaac <[EMAIL PROTECTED]> wrote: > A Dijous 21 Desembre 2006 05:59, A. M. Archibald escrigué: > > It seems to me that numpy should include only tools for > > basic calculations on arrays of numbers. The ufuncs, > > simple wrappers (dot, for examp

Re: [Numpy-discussion] Newbie Question, Probability

2006-12-20 Thread A. M. Archibald
LAS' routine from BLAS. Of course, numpy is currently fettered by the need to maintain some sort of compatibility with Numeric and numarray; shortly it will have to worry about compatibility with previous versions of numpy as well. A. M. Archibald ___

Re: [Numpy-discussion] rollaxis

2006-12-13 Thread A. M. Archibald
s = list(A.shape) s.remove(i) s.append(i) B = A.transpose(s) A. M. Archibald ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] fiddling the strides of an array

2006-11-19 Thread A. M. Archibald
On 19/11/06, Filip Wasilewski <[EMAIL PROTECTED]> wrote: > On 11/19/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a function that would like to be able to take an array, look at > > its 'strides' and 'shape' tup

[Numpy-discussion] fiddling the strides of an array

2006-11-19 Thread A. M. Archibald
at I'm doing with these strides, use the same underlying memory as this array"? (Of course I can flatten the array, but that will copy it unnecessarily.) Thanks, A. M. Archibald ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion