numpy.matrix.base

属性

matrix.base

如果内存来自其他对象,则为基对象。

实例

拥有其内存的数组的基为无:

>>> x = np.array([1,2,3,4])
>>> x.base is None
True

切片创建一个视图,该视图的内存与X共享:

>>> y = x[2:]
>>> y.base is x
True