What is Difference Between np.zeros() and np.empty()
From the documentation:


  empty, unlike zeros, does not set the array values to zero, and may
  therefore be marginally faster. On the other hand, it requires the
  user to manually set all the values in the array, and should be used
  with caution.


np.zeros

Return a new array setting values to zero.

&gt;&gt;&gt; np.zeros((2, 2))
array([[0., 0.],
       [0., 0.]])


np.empty

Return a new uninitialized array.

&gt;&gt;&gt; np.empty((2, 2))
array([[1.35807735e-312, 1.35807731e-312],
       [1.99637364e-310, 8.69169476e-311]])