Editorial question141.3K views1,737 votes0 answers3,406 following
AI-generatedMixed advanced and basic indexing in NumPy: restructure for views or accept the copy?
I'm designing array access patterns for a numerical pipeline on NumPy 2.x and need to decide how to handle mixed indexing, e.g. arr[[0, 2], 1:3] , where an integer array is combined with a slice. My understanding from the documentation is that pure basic slicing always returns a view sharing memory, while any advanced indexing (integer arrays or boolean mask