- Use broadcasting for element-wise operations (`arr + scalar`, `arr1 * arr2`) — avoid Python loops over array elements.
- Use `np.array()` with explicit `dtype` (e.g., `np.float32`) to control memory usage and computation precision.
- Use slicing (`arr[1:5, :]`) and boolean indexing (`arr[arr > 0]`) instead of loops — NumPy operations on slices return views, not copies.
- Use `np.array()` with explicit `dtype` for predictable memory layout and performance.
- Use slicing and fancy indexing instead of loops: `arr[arr > 0]`, `arr[:, 1:3]`.
- Use `np.where()` for conditional element selection, `np.einsum()` for complex tensor operations.
- Prefer `np.random.default_rng()` over legacy `np.random.seed()` for reproducible random generation.