This is documentation for an old release of NumPy (version 1.3.). Read this page in the documentation of the latest stable release (version > 1.17).

numpy.ma.empty_like

numpy.ma.empty_like(a)

Create a new array with the same shape and type as another.

Parameters:

a : ndarray

Returned array will have same shape and type as a.

See also

zeros_like, ones_like, zeros, ones, empty

Notes

This function does not initialize the returned array; to do that use zeros_like or ones_like instead.

Examples

>>> a = np.array([[1,2,3],[4,5,6]])
>>> np.empty_like(a)
>>> np.empty_like(a)
array([[-1073741821, -1067702173,       65538],    #random data
       [      25670,    23454291,       71800]])

Previous topic

numpy.ma.empty

Next topic

numpy.ma.masked_all

This Page

Quick search