Changes between Version 30 and Version 31 of coding_rules
- Timestamp:
- 08/20/20 15:50:58 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
coding_rules
v30 v31 143 143 || `find('cond1'&'cond2')` || `np.where(np.logical_and.reduce(('cond1','cond2'))[0]` || Find the indices where `'cond1'` and `'cond2'` are met.[[BR]][[BR]]The same protocol can be followed for MATLAB's `|` by instead using `logical_or`.[[BR]][[BR]]More than two conditions may be compounded. || 144 144 || `v = nonzeros(A)` || `v = A[np.nonzero(A)]` || Find the values of the nonzero elements || 145 || `B =sortrows(A,column)` || `B = A[A[:,column].argsort()]` || sort rows of matrix or table (MATLAB), or 2D array (!NumPy) in ascending order based on the elements in 'column' ||145 || `B = sortrows(A,column)` || `B = A[A[:,column].argsort()]` || sort rows of matrix or table (MATLAB), or 2D array (!NumPy) in ascending order based on the elements in 'column' || 146 146 147 147 == !Variable/Enum/Function Names ==