Hello,
It looks like the spammers have figured out how to use our trac site
again. I locked down the trac site a bit to make it more difficult
for them. Basically, I removed some of the default permissions that
all users get. I don't think this will effect many people; but if you
have a trac ac
On Dec 16, 2007 7:58 PM, elfnor <[EMAIL PROTECTED]> wrote:
> Is there a more concise way of assigning a variable to each column of an
> array?
>
> This works
>
> x,y,z = X[:,0],X[:,1],X[:,2]
>
> but seems clumsy.
You could try:
x, y, z = X.T
Although some people might think that's a little obs
Is there a more concise way of assigning a variable to each column of an array?
This works
x,y,z = X[:,0],X[:,1],X[:,2]
but seems clumsy.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-dis
"or" is logical or. You want "|" which is bitwise/elementwise or. Also,
watch the order of operations -- | has higher precedence than <.
Thus, you want
where( (a<1) | (b<3), b,c)
Ross Harder wrote:
> What's the correct way to do something like this?
>
> a=array( (0,1,1,0) )
> b=array( (4,3,2,1)
use '+' instead of 'or' for bool arrays.
In [8]: numpy.where((a<1) + (b<3), b, c)
Out[8]: array([4, 2, 2, 1])
hth,
L.
On Dec 16, 2007 8:10 PM, Ross Harder <[EMAIL PROTECTED]> wrote:
>
> What's the correct way to do something like this?
>
> a=array( (0,1,1,0) )
> b=array( (4,3,2,1) )
> c=array(
What's the correct way to do something like this?
a=array( (0,1,1,0) )
b=array( (4,3,2,1) )
c=array( (1,2,3,4) )
where( (a<1 or b<3), b,c)
Python throws a ValueError
I would expect to get an array that looks like
[4,2,2,1] I think
Thanks,
Ross
On 16/12/2007, Hans Meine <[EMAIL PROTECTED]> wrote:
> (*: It's similar with math.hypot, which I have got to know and appreciate
> nowadays.)
I'd like to point out that math.hypot is a nontrivial function which
is easy to get wrong:
In [6]: x=1e200; y=1e200;
In [7]: math.hypot(x,y)
Out[7]: 1.41
On Sonntag 16 Dezember 2007, Neil Crighton wrote:
> Do we really need these functions in numpy? I mean it's just
> multiplying/dividing the value by pi/180 (who knows why they're in the
> math module..).
I like them in math ("explicit is better than implicit"*), but I don't want to
comment on wh
Do we really need these functions in numpy? I mean it's just
multiplying/dividing the value by pi/180 (who knows why they're in the
math module..). Numpy doesn't have asin, acos, or atan either (they're
arcsin, arcos and arctan) so it isn't a superset of the math module.
I would like there to be