Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract dominant periods from data #70

Open
q121212 opened this issue Dec 11, 2020 · 0 comments
Open

Extract dominant periods from data #70

q121212 opened this issue Dec 11, 2020 · 0 comments

Comments

@q121212
Copy link

q121212 commented Dec 11, 2020

hello, I would like to use the spectrum library for extracting periods from data of time series
as I understand it, the strongest frequencies (in the case below) is: 0.2, 0.33 and 0.36
Please, tell me is this correct understanding? Or maybe there is a better way to do this?
And the second question: method p.plot() allows you to plot frequencies, but where can you find the power values?

test case:

import numpy as np
import pandas as pd

data=[77943,119335,562383,29789,20429,40612,20523,722055,40659,6521,20008,
      20605,130027,1172649,29964,22227,80446,20008,518405,16597,20322,24951,
      70791,1224887,51838,38906,20258,630595,12250,40800]
data=np.asarray(data)

p=Periodogram(data)
p.periodogram()
p.plot()

p.periodogram()
f=p.frequencies()
f=pd.Series(f)
pd.DataFrame([1/f,f], index=['period', 'freq'])

Result:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant