Skip to content

Extract dominant periods from data  #70

@q121212

Description

@q121212

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions