Home>
Assumptions

I have a dataset like this

Unnamed: 0 time test test2
0 0 15: 56: 03: 401674 NaN NaN
1 1 15: 56: 03: 494158 0.000222 0.000000
2 2 15: 56: 03: 594907 0.000000 0.000000
3 3 15: 56: 03: 740971 0.000000 0.000000
4 4 15: 56: 03: 870857 0.000000 0.000000
5 5 15: 56: 04: 003207 0.000000 0.000000
6 6 15: 56: 04: 127827 0.000000 0.000000
7 7 15: 56: 04: 273483 0.000000 0.000000
8 8 15: 56: 04: 402328 0.000349 0.001583
9 9 15: 56: 04: 485437 0.007471 0.009965
10 10 15: 56: 04: 666454 0.024821 0.050704
11 11 15: 56: 04: 817290 -0.000920 0.012854
12 12 15: 56: 04: 978378 -0.013256 -0.105881
13 13 15: 56: 05: 102569 0.002745 0.003255

The above data is time-series data. I would like to perform frequency analysis by performing FFT oftest. I want data with the horizontal axis of frequency from the time axis.

Question

How should I perform frequency analysis at this time?
There is an fft library in scipy, but I can't use it well. I saw a lot of sites, but it was difficult and difficult for me.
I want to convert from time axis data to frequency axis data.

If anyone in Python knows how to do it, it would be helpful if you could explain it with specific code.

  • Answer # 1

    Solved.

    Because the first numerical value was NaN, it seems that it was useless to treat the initial input properly as a numerical value.
    Programming is messed up in such an insignificant situation, so it was easy, but I was glad to solve it myself.

    I'm glad that you understand the Fourier transform and the code.
    Leave it to be useful when someone gets stuck again!