[Numpy-discussion] Advanced indexing: "fancy" vs. orthogonal

Nathaniel Smith njs at pobox.com
Thu Apr 2 23:30:02 EDT 2015


On Thu, Apr 2, 2015 at 6:35 PM,  <josef.pktd at gmail.com> wrote:
> (I thought about this because I was looking at accessing off-diagonal
> elements, m2[np.arange(4), np.arange(4) + 1] )

Psst: np.diagonal(m2, offset=1)

-- 
Nathaniel J. Smith -- http://vorpus.org



More information about the NumPy-Discussion mailing list