2009/3/25 Jesper Larsen <jesper.webm...@gmail.com>: > import numpy as npy > a = npy.empty((2), dtype=npy.object_) > > # Works fine: > for i in range(len(a)): > a[i] = [] > print a > > # Does not work: > a[:] = [] > a[:] = list()
Slightly simpler would be: In [26]: x = np.empty((2,), dtype=object) In [27]: x[:] = [[] * len(x)] Stéfan _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion