Yes, if I am doing this more than once in some code I would make a helper. But
it's much better I think to have a common function that people can learn and
use consistently instead of having to roll their own functions all the time.
Especially because numpy otherwise usually just works when you write the
algorithm how you write it on paper. There shouldn't need to be too much
thinking involved in the translation.
Also yeah using fancy index tricks like `rowmat` and `colmat` simplifies the
code a bit, but is still obscure and esoteric looking to somebody who's not
intimately familiar with numpy indexing.
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com