Your syntax is not as intuitive as you may think.
Suppose I take a matrix instead
a = np.array([1,2,3,4]).reshape(2,2)
b = (a>1) # np.array([[False,True],[True,True]])
How would a[b,np.newaxis] be supposed to work?
Note that other (simple) slices work perfectly with newaxis, such as
a[:1,np.new
Dear NumPy gurus,
I don't get the difference between frompyfunc and vectorize. What is
their respective use cases?
Thanks!
== Olivier
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
2009/6/8 Christopher Barker
> Olivier Verdier wrote:
> > One
> > should realize that allowing dot(A,B,C) is just *better* than the
> > present situation where the user is forced into writing dot(dot(A,B),C)
> > or dot(A,dot(B,C)).
>
> I'm lost now -- how
to
one of the above forms if he really knows which is best for him. So I fail
to see exactly where the problem is...
== Olivier
2009/6/7 Robert Kern
> On Sun, Jun 7, 2009 at 04:44, Olivier Verdier wrote:
> > Yes, I found the thread you are referring
> > to: http://mail.python.org/
.
== Olivier
2009/6/7 Tom K.
>
>
> Olivier Verdier-2 wrote:
> >
> > There would be a much simpler solution than allowing a new operator. Just
> > allow the numpy function dot to take more than two arguments. Then A*B*C
> > in
> > matrix notation would
)?
The performance and precision problems are the responsability of the user,
just as with the formula A*B*C.
== Olivier
2009/6/7 Robert Kern
> On Sun, Jun 7, 2009 at 02:43, Olivier Verdier wrote:
> > There would be a much simpler solution than allowing a new operator. Just
> >
There would be a much simpler solution than allowing a new operator. Just
allow the numpy function dot to take more than two arguments. Then A*B*C in
matrix notation would simply be:
dot(A,B,C)
with arrays. Wouldn't that make everybody happy? Plus it does not break
backward compatibility. Am I mis
er
to teach with dot. Then the relation matrix/vector/scalar is crystal clear.
== Olivier
2009/6/5 Alan G Isaac
> On 6/5/2009 11:38 AM Olivier Verdier apparently wrote:
> > I think matrices can be pretty tricky when used for
> > teaching. For instance, you have to explain that all th
I agree. It would be a good idea to have matrices out of numpy as a
standalone package.
Indeed, having matrices in the numpy core comes at a pedagogical cost.
Newcomers (as I once was) do not know which to use. Matrix or array? It
turns out that the vast majority of numpy/scipy modules use arrays,
I really don't see any advantage of matrices over arrays for teaching. I
prefer to teach linear algebra with arrays.
I would also like matrices to disappear from numpy. But then one would need
a new implementation of scipy.sparse, which is (very unfortunately)
matrix-based at the moment.
== Olivie
Anne, thank you, this was the example I was looking for. Indeed A!=B
would not work as expected if the bool(A) always returned A.all(). Now
I can teach my student why there is no automatic conversion from
boolean arrays to booleans.
== Olivier
On 18/04/2008, Anne Archibald <[EMAIL PROTECTED]> wro
on. Why is there an exception
raising at all?
I hope that my question is clearer now...
Thanks.
On 18/04/2008, David Douard <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 18, 2008 at 01:11:37PM +0200, Olivier Verdier wrote:
> > In mathematics, if I compare two function, it mea
In mathematics, if I compare two function, it means that I compare on
all its "coordinates". If I say "f < g" I mean "f(x) < g(x) for all
x".
The same holds for a vector, if I write "v == w" I mean "v[i] == w[i]
for all i".
How come this doesn't work in numpy? And why the message about the
truth
13 matches
Mail list logo