fft of a dat file?

R. David Murray rdmurray at bitdance.com
Wed Mar 25 09:52:37 EDT 2009


Soumen banerjee <soumen08 at gmail.com> wrote:
> Hello
> I have not tried the code because in no part of the code is the array
> "out" being created. As such, it is bound to return an error that out
> isnt created. The point here is how i can get sampled values from the
> dat file which has lines like this:-
> 
> <sampling Time>    <sampled Value>   \r\n
> 
> i need to isolate the sampled values and put them into an array.

Maybe something like:

samples = []
with open('myfile') as f:
    for line in f:
        time, value = line.strip().split()
        samples.append([float(time), float(value)])

Modify as appropriate to your actual needs.

--
R. David Murray           http://www.bitdance.com




More information about the Python-list mailing list