Spaces:
Sleeping
Sleeping
main data_load api init
Browse files- data_prep/data_load.py +14 -0
data_prep/data_load.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
|
| 3 |
+
from data_prep.basic_feat import add_daily_return , indexify_date
|
| 4 |
+
from data_prep.features import add_all_indicators
|
| 5 |
+
|
| 6 |
+
def prepare_data(path : str) -> pd.DataFrame:
|
| 7 |
+
df = pd.read_csv(path)
|
| 8 |
+
|
| 9 |
+
df = indexify_date(df)
|
| 10 |
+
df = add_daily_return(df)
|
| 11 |
+
|
| 12 |
+
return add_all_indicators(df)
|
| 13 |
+
|
| 14 |
+
|