Home / NumPy / Pre-filling: np.<empty|zeros|ones|full>[_like]
Example: The _like
variants inherit shape
and dtype
import numpy as np
a = np.array([10, 20, 30])
b = np.empty_like(a)
(b.shape, b.dtype)
((3,), dtype('int64'))