As for the
CodeReview
migration, simply because he asks for 'improvement' and 'simpler', does not mean it is as bad fit for SO. Questions about removing nested for loops get asked, and answered, every day. If there's a difference, CR is pickier about the code being complete and working, and the answers seem to be more details, with as much focus on style as speed. SO answers (at least mine for
numpy
) like concise questions which can focus on a particular "vectorization" method - reshape, transpose, broadcasting, indexing etc. —
hpaulj 10 secs ago