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
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
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
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
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
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
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
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
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
___
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
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
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
12 matches
Mail list logo