aboutsummaryrefslogtreecommitdiffstats
path: root/python/markit
diff options
context:
space:
mode:
Diffstat (limited to 'python/markit')
-rw-r--r--python/markit/import_quotes.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/markit/import_quotes.py b/python/markit/import_quotes.py
index 9892478b..d32fdf6c 100644
--- a/python/markit/import_quotes.py
+++ b/python/markit/import_quotes.py
@@ -137,8 +137,8 @@ def insert_index(engine, workdate=None):
'Version': 'version', 'Term': 'tenor',
'Composite Price': 'close_price',
'Composite Spread': 'close_spread',
- 'Model Price': 'modelprice', 'Model Spread': 'modelspread'}
- ext_cols = ['date', 'index', 'series', 'version', 'tenor'] + cols
+ 'Model Price': 'model_price', 'Model Spread': 'model_spread'}
+ ext_cols = ['date', 'index', 'series', 'version', 'tenor'] + cols + ['source']
dates_to_files = {}
for f in filenames:
@@ -156,7 +156,7 @@ def insert_index(engine, workdate=None):
for f in filenames:
data = pd.read_csv(f, skiprows=2, parse_dates=[0, 7], engine='python')
data = data.rename(columns=colmapping)
- data.dropna(subset=['closeprice'], inplace=True)
+ data.dropna(subset=['close_price'], inplace=True)
for col in cols:
data[col] = data[col].str.replace('%', '').astype('float')
data['tenor'] = data['tenor'].apply(lambda x: x.lower()+'r')
@@ -167,6 +167,7 @@ def insert_index(engine, workdate=None):
## we renumbered the version for HY9, 10 and 11
data.loc[data.series.isin([9, 10, 11]) & (data.index=='HY'), 'version'] -= 3
#data = data.groupby(['index', 'series', 'tenor', 'date'], as_index=False).last()
+ data['source'] = 'MKIT'
data[ext_cols].to_sql('index_quotes_pre', engine, if_exists='append', index=False)
def insert_tranche(engine, workdate=None):