![](https://secure.gravatar.com/avatar/60b2f3743998636b2bbb80cde9b93a91.jpg?s=120&d=mm&r=g)
3 May
2006
3 May
'06
8:11 a.m.
Hi, I just stumbled upon something... In [15]: a Out[15]: array([[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]) In [16]: b = array([False, True, True, True, False]) In [17]: a[b] Out[17]: array([[2, 3], [4, 5], [6, 7]]) In [18]: a[b,:] --------------------------------------------------------------------------- exceptions.IndexError Traceback (most recent call last) /home/jloehnert/python/ratchet/<console> IndexError: arrays used as indices must be of integer type In [19]: a[nonzero(b),:] Out[19]: array([[2, 3], [4, 5], [6, 7]]) In [20]: numpy.__version__ Out[20]: '0.9.7.2473' Why does a[b, :] not work? Johannes
6636
Age (days ago)
6636
Last active (days ago)
0 comments
1 participants
participants (1)
-
Johannes Loehnert