Python loadtxt function is not working -
i attempting following program.
from numpy import zeros,loadtxt pylab import plot,xlim,show cmath import exp,pi def dft(y): n = len(y) c = zeros(n//2+1,complex) k in range(n//2+1): n in range(n): c[k] += y[n]*exp(-2j*pi*k*n/n) return c y = loadtxt("pitch.txt",float) c = dft(y) plot(abs(c)) xlim(0,500) show()
however, when attempt run program, receive error code line 13:
y = loadtxt("pitch.txt",float) file "c:\python32\lib\site-packages\numpy\lib\npyio.py", line 689, in loadtxt fh = iter(open(fname, 'u')) ioerror: [errno 2] no such file or directory: 'pitch.txt'
i given file has resources needed run program, , uploaded them same folders have python program saved in. pitch.txt file text file single column of numbers. i'm wondering if there wrong written program, or did upload files in wrong.
Comments
Post a Comment