diff options
Diffstat (limited to 'python/insert_index.py')
| -rw-r--r-- | python/insert_index.py | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/python/insert_index.py b/python/insert_index.py index 1223b0f0..ce130fcd 100644 --- a/python/insert_index.py +++ b/python/insert_index.py @@ -6,11 +6,11 @@ metadata = MetaData(bind = engine) index_desc = Table('index_desc', metadata, autoload=True)
index_ins = index_desc.insert()
-offset=182970
-# index = [[offset, 'EU', 19, datetime.date(2016, 06, 20), 'Y3', 100, 0],
-# [offset, 'EU', 19, datetime.date(2018, 06, 20), 'Y5', 100, 0],
-# [offset, 'EU', 19, datetime.date(2020, 06, 20), 'Y7', 100, 0],
-# [offset, 'EU', 19, datetime.date(2023, 06, 20), 'Y10', 100, 0]]
+offset=183000
+index = [[offset, 'EU', 21, datetime.date(2017, 6, 20), 'Y3', 100, 0],
+ [offset, 'EU', 21, datetime.date(2019, 6, 20), 'Y5', 100, 0],
+ [offset, 'EU', 21, datetime.date(2021, 6, 20), 'Y7', 100, 0],
+ [offset, 'EU', 21, datetime.date(2024, 6, 20), 'Y10', 100, 0]]
# index = [[offset, 'HY', 21, datetime.date(2016, 12, 20), 'Y3', 100, 0],
# [offset, 'HY', 21, datetime.date(2018, 12, 20), 'Y5', 100, 0],
@@ -38,31 +38,41 @@ for line in index: tranche_desc = Table('tranche_desc', metadata, autoload = True)
tranche_ins = tranche_desc.insert()
-igbasketid = 182990
-igattach = [0, 3, 7, 15, 100]
-igtenors = ['Y3', 'Y5', 'Y7', 'Y10']
-for tenor in igtenors:
- for i, (attach, detach) in enumerate(zip(igattach[:-1], igattach[1:])):
- with engine.begin() as conn:
- conn.execute(tranche_ins,
- trancheid = igbasketid+i,
- basketid = igbasketid,
- tenor = tenor,
- attach=attach,
- detach = detach)
+# igbasketid = 182990
+# igattach = [0, 3, 7, 15, 100]
+# igtenors = ['Y3', 'Y5', 'Y7', 'Y10']
+# for tenor in igtenors:
+# for i, (attach, detach) in enumerate(zip(igattach[:-1], igattach[1:])):
+# with engine.begin() as conn:
+# conn.execute(tranche_ins,
+# trancheid = igbasketid+i,
+# basketid = igbasketid,
+# tenor = tenor,
+# attach=attach,
+# detach = detach)
+
+# hybasketid = 182970
+# hyattach = [0, 15, 25, 35, 100]
+# hytenors = ['Y3', 'Y5', 'Y7']
+# for tenor in hytenors:
+# for i, (attach, detach) in enumerate(zip(hyattach[:-1], hyattach[1:])):
+# with engine.begin() as conn:
+# conn.execute(tranche_ins,
+# trancheid = hybasketid+i,
+# basketid = hybasketid,
+# tenor = tenor,
+# attach = attach,
+# detach = detach)
-hybasketid = 182970
-hyattach = [0, 15, 25, 35, 100]
-hytenors = ['Y3', 'Y5', 'Y7']
-for tenor in hytenors:
- for i, (attach, detach) in enumerate(zip(hyattach[:-1], hyattach[1:])):
+eubasketid = 183000
+euattach = [0, 3, 6, 12, 100]
+eutenors = ['Y3', 'Y5']
+for tenor in eutenors:
+ for i, (attach, detach) in enumerate(zip(euattach[:-1], euattach[1:])):
with engine.begin() as conn:
conn.execute(tranche_ins,
- trancheid = hybasketid+i,
- basketid = hybasketid,
+ trancheid =eubasketid+i,
+ basketid = eubasketid,
tenor = tenor,
attach = attach,
detach = detach)
-
-# euattach = [0, 3, 6, 9, 12, 22, 100]
-# eutenors = ['Y3', 'Y5', 'Y7']
|
