zeros() and ones() (NumPy)

np.zeros() and np.ones() create new arrays of a given shape filled entirely with 0s or 1s. They are the usual way to pre-allocate an array you will fill in…