They should all be equivalent, yeah. Be careful about !isnan(SP[!,par][ind]
, though. That’s fast, but !isnan(SP[:, par][ind])
will be slow (the :
allocates a new vector).
It’s good practice to use let
for these multi-line blocks so you don’t clutter your namespace with temporary variables.