aboutsummaryrefslogtreecommitdiffstats
path: root/python/insert_tranche_quotes.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/insert_tranche_quotes.py')
-rw-r--r--python/insert_tranche_quotes.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/insert_tranche_quotes.py b/python/insert_tranche_quotes.py
index 3fae9930..e680aee2 100644
--- a/python/insert_tranche_quotes.py
+++ b/python/insert_tranche_quotes.py
@@ -20,10 +20,11 @@ tenordict = {'3': '3yr', '5': '5yr', '7':'7yr', '10':'10yr'}
runningdict1 = {0: 500, 3:100, 7:100, 15: 25}
runningdict2 = {0: 500, 3:500, 7:500, 10:100, 15:100, 30:100}
-def insert_quotes(year=2014):
- root_dir = '/home/share/CorpCDOs'
- quote_dir = os.path.join(root_dir, 'Tranche_data', 'Quotes')
- quotefiles = [f for f in os.listdir(quote_dir) if 'csv' in f]
+def insert_quotes(year=2014, quote_dir=None):
+ if not quote_dir:
+ root_dir = '/home/share/CorpCDOs'
+ quote_dir = os.path.join(root_dir, 'Tranche_data', 'Quotes')
+ quotefiles = [f for f in os.listdir(quote_dir) if f.endswith('csv')]
for quotefile in quotefiles:
with open(os.path.join(quote_dir, quotefile)) as fh:
reader = csv.DictReader(fh)