@ Scipy lecture notes, Edition 2017.1
3.1.6 Copies and views
You can use
np.may_share_memory()to check if two arrays share the
same memory block. Note however, that this uses heuristics and may give you false positives.
A return of True does not necessarily mean that the two arrays share any element. It just means that they might.