The Python Oracle

Slicing of a NumPy 2d array, or how do I extract an mxm submatrix from an nxn array (n>m)?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Techno Intrigue Looping

--

Chapters
00:00 Question
01:56 Accepted answer (Score 68)
02:39 Answer 2 (Score 118)
05:36 Answer 3 (Score 15)
06:37 Answer 4 (Score 11)
08:11 Thank you

--

Full question
https://stackoverflow.com/questions/4257...

Question links:
[on a forum]: http://www.velocityreviews.com/forums/t6...

Answer 1 links:
[the NumPy documentation on indexing]: http://docs.scipy.org/doc/numpy-1.5.x/re...
[broadcasted]: http://docs.scipy.org/doc/numpy-1.5.x/re...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #numpy #slice

#avk47