Spaces:
Runtime error
Runtime error
File size: 932 Bytes
3af04c7 9823ef6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import pandas as pd
import statsmodels.api as sm
data_set_options = [
'Earthquake time series',
'Stationarized temperature time series',
'Sunspots'
]
def import_sample_data(sample_data_selected, data_set_options):
if sample_data_selected == data_set_options[0]:
data = pd.read_csv('data/processed/earthquake.csv',
parse_dates=['date'], index_col='date')
if sample_data_selected == data_set_options[1]:
data = pd.read_csv('data/processed/stationary_temp_NY.csv',
parse_dates=['DATE'], index_col='DATE')
if sample_data_selected == data_set_options[2]:
dta = sm.datasets.sunspots.load_pandas().data
dta.index = pd.Index(sm.tsa.datetools.dates_from_range('1700', '2008'))
del dta["YEAR"]
data = dta
graph_data = data.reset_index()
graph_data.columns.values[0] = 'Date'
return data, graph_data
|