I'm having a problem I haven't seen elsewhere (and apologies if it has been answered before).
I see the following behavior (copied verbatim from a python session):
Python 2.7.4 (default, Apr 6 2013, 19:55:15) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> x=[[np.zeros(10)] for i in range(10)] >>> x.index(x[0]) 0 >>> x.index(x[1]) Traceback (most recent call last): File "", line 1, in ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() >>> x[1].append(np.zeros(10)) >>> x.index(x[1]) 1
Any ideas why I see a ValueError when trying to find the index of a list containing a single ndarray?
-Matt