In the Scipy documents written that :
The function zeros creates an array full of zeros, the function ones creates an array full of ones, and the function empty creates an array whose initial content is random and depends on the state of the memory. By default, the dtype of the created array is float64.
So I was ran this code :
import numpy as np
np.empty((1,2))
And it's return :
array([[ 6.92892901e-310, 8.42664136e-317]])
So it's return a random numbers and all of things are great .
But, when I was running that code for the second time (in that shell) it's return a zero array !
np.empty((1,2))
array([[ 0., 0.]])
And here is the question, why it's return zero array at the second time (instead of random number) ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…