In your first case, you are creating an array called x that will containing one value, which is 0.
In your second case you are creating an empty array called x that will contain no values, but is still an array.
FIRST CASE
So when you append x = np.append(x,1), the value 1 get's appended to your array (which already contains 0) i.e. it now contains 0 and 1
SECOND CASE
Since you have no values in the empty array, when you append x=np.append(x,1) the value 1 get's appended and the length of x becomes 1 (i.e. it now contains only 1)
P.S. I believe you might have thought that calling x = np.array(0) with the 0 would make it an empty array, it doesn't!! In Python, 0 is still taken to be a number and is appended to the array.
np.array(0)is an array containing 0. whereasnp.array([])is an empty array containing nothing.