471,356 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

arrays in lists

Hi!

I have a list of arrays and want to find an array with list.index(x).
Is that possible. I get an
ValueError: The truth value of an array with more than one element is
ambiguous. Use a.any() or a.all()
For example:
from numpy import array
a = array([1])
b = array([2])
c = [a,b]
d = c.index(a)

Thank you.
Dec 17 '07 #1
1 1135
On 17 déc, 14:05, "Peter Stahlir" <peter.stah...@googlemail.com>
wrote:
For example:
from numpy import array
a = array([1])
b = array([2])
c = [a,b]
d = c.index(a)
No problem here, Python 2.4.4
Dec 17 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Hilde Roth | last post: by
35 posts views Thread by Troll | last post: by
5 posts views Thread by Cant Think Today | last post: by
11 posts views Thread by Soeren Sonnenburg | last post: by
4 posts views Thread by bei | last post: by
51 posts views Thread by Joerg Schoen | last post: by
12 posts views Thread by rshepard | last post: by
1 post views Thread by Erland Sommarskog | last post: by
5 posts views Thread by Tobiah | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.