I have this basic example to understand the numpy append method.
distances=[]
for i in range (8):
distances = np.append(distances, (i))
print(distances)
distances=[]
for i in range (8):
distances.append(i)
print(distances)
The output gives me 2 arrays but are in different format (or what I understand of different format).
[ 0. 1. 2. 3. 4. 5. 6. 7.]
[0, 1, 2, 3, 4, 5, 6, 7]
What is the exact different of both arrays and why is the output different?
iis the same for both, I do not understand why one would be floats and the other one ints.@DavidGnp.appendis a numpy function that is named like the listappend, but is a poor replica. I discourage using it. It gives beginners too many problems (like 4-5 SO questions in the last couple of days).