Why does the name of np.ix_
contain a trailing underscore?
I can't give a complete reason, but it's for symmetry with np.r_
, np.c_
, etc. I can make a guess for the overall reason:
All of the short numpy operators like np.r_
, np.ix_
, etc are oriented towards interactive use.
Therefore, it's common (although not advisible) to do from numpy import *
in an interactive console.
r
, c
, ix
, etc, are likely to be variable names. Therefore, they're probably suffixed with _
to prevent getting clobbered when a user defines a variable named r
or ix
in an interactive session after doing from numpy import *
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With