3 ms·
I think a fairer comparison would be np.linalg.norm(x) or even norm(x) if you import numpy.linalg.norm as norm beforehand. This comes with the
by johndough 5y ago
I think a fairer comparison would be
np.linalg.norm(x)
or even
norm(x)
if you
import numpy.linalg.norm as norm
beforehand. This comes with the advantage that you can look up the function by name to know what it does instead of having to look up chains of symbols on several websites.
- RodgerTheGreat 5y agoIn practice, if you're reading a J expression which contains unfamiliar primitives, there's only one place you need to look: https://code.jsoftware.com/wiki/NuVoc https://code.jsoftware.com/wiki/NuVoc Idioms are composed from primitives, but many of them are shorter than a descriptive name would be, and since the set of primitives is small (compared to the standard library in most languages), it doesn't take that long to memorize most or all of the symbols.