On Tue, Jul 13, 2010 at 10:36 AM, Pauli Virtanen <[email protected]> wrote: > ti, 2010-07-13 kello 10:06 -0700, Keith Goodman kirjoitti: >> No need to use where. You can just do a[np.isnan(a)] = 0. But you do >> have to watch out for 0d arrays, can't index into those. > > You can, but the index must be appropriate: > >>>> x = np.array(4) >>>> x[()] = 3 >>>> x > array(3)
Then should this error message be changed? >> a = np.array(4) >> a[1] <snip> IndexError: 0-d arrays can't be indexed _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
