0
Hello, I’m getting this error return while trying to run the following loop:
for p in p:
for q in p:
if p != q:
arrFreq.append(p - q)
OBS: "p" is an array that contains frequencies of an audio. The final idea of this for
is to store the difference between frequencies. The "if
" is not to pass the same value in the array. For example, you have to calculate the difference of the p[0]
, p[1]...
Can’t calculate p[0]
with p[0]
.
I don’t know what you wanted with this code - but it’s very wrong. if the variables were right in "for", you’d have one
arrFreq
with the square of the number of frequencies of your original sample, with the differences between all of them, as in a tabuada - which obviously would not serve for anything.– jsbueno
If you have two Numpy arrays of the same size, to subtract one from the other and have a new array, just use "-" - nor need any:
diferencas = p -q
– jsbueno