Quansight-Labs / ndindex

A Python library for manipulating indices of ndarrays
https://quansight-labs.github.io/ndindex/
MIT License
97 stars 12 forks source link

Add is_view method #149

Open asmeurer opened 1 year ago

asmeurer commented 1 year ago

Need a method that returns True iff the index would produce a view. Should be quite simple to implement.

asmeurer commented 5 months ago

Actually, there's one annoying thing here. NumPy scalars are never views, because they are supposed to be immutable. It's impossible to tell if an index would produce a scalar or not without knowing the shape of the array.