pyFTS/pyFTS/data/sunspots.py

32 lines
776 B
Python
Raw Normal View History

2018-08-30 23:04:52 +04:00
"""
Monthly sunspot numbers from 1749 to May 2016
Source: https://www.esrl.noaa.gov/psd/gcos_wgsp/Timeseries/SUNSPOT/
"""
from pyFTS.data import common
import pandas as pd
import numpy as np
2021-08-16 22:01:37 +04:00
def get_data() -> np.ndarray:
2018-04-14 17:22:02 +04:00
"""
Get a simple univariate time series data.
2018-04-14 17:22:02 +04:00
:return: numpy array
"""
dat = get_dataframe()
dat = np.array(dat["SUNACTIVITY"])
return dat
2021-08-16 22:01:37 +04:00
def get_dataframe() -> pd.DataFrame:
2018-04-14 17:22:02 +04:00
"""
Get the complete multivariate time series data.
2018-04-14 17:22:02 +04:00
:return: Pandas DataFrame
"""
dat = common.get_dataframe('sunspots.csv',
'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/sunspots.csv',
sep=",")
return dat