Indexing Bottlenecks: Costly Copies from Fancy Indexing

Unlike basic slicing, NumPy's 'fancy indexing' (using integer arrays or boolean masks) almost always returns a copy of the data, not a view. This can lead to significant performance and memory overhead for large arrays, as new memory is allocated and data copied.

Sources

Open the full topic