-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_loaddata.py
executable file
·64 lines (55 loc) · 1.67 KB
/
_loaddata.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# TO BE CLEANED -----------------------------
# Modules
import pandas as pd
import os as os
import statistics as stcs
import numpy as np
import itertools as itr
import pandas as pd
import statsmodels.formula.api as sm
import datetime
import yaml
import importlib
#temp
import matplotlib.pyplot as plt
# Import SETTINGS-file
with open("./SETTINGS.yml", 'r') as stream:
try:
SETTINGS = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
# Import helpers
spec = importlib.util.spec_from_file_location("noname", "./gen_helpers.py")
helpers = importlib.util.module_from_spec(spec)
spec.loader.exec_module(helpers)
# ----------------------------------
def load_data(self,
coindata_dir):
dtalist = list()
for file in self.coindata_files:
dta_raw = pd.read_csv(coindata_dir+file)
dta = dta_raw[::-1].reset_index(drop=True)
dtalist.append(dta)
print("|---| Loaded : |---| " + file)
return(dtalist)
def load_yfinance_data(self,
path,
name):
yfdata = helpers.load_obj(name = name,
path = path)
print("|---| Loaded : |---| " + path + name)
return(yfdata)
def load_crix_data(self,
path,
name):
crixdata = helpers.load_obj(name = name,
path = path)
print("|---| Loaded : |---| " + path + name)
return(crixdata)
def load_cmi10_data(self,
path,
name):
cmi10data = helpers.load_obj(name = name,
path = path)
print("|---| Loaded : |---| " + path + name)
return(cmi10data)