aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/analytics/tranche_basket.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 89a4e31f..555bc217 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -222,7 +222,8 @@ class DualCorrTranche():
"{:<20}\t{:>15}".format("Direction", self.direction)]
rows = [["Notional", self.notional, "PV", self.pv *100],
["Attach", self.attach, "Detach", self.detach],
- ["Attach Corr", self.rho[0] * 100, "Detach Corr", self.rho[1] * 100],
+ ["Attach Corr", self.rho[0] * 100 if self.rho[0] else "N/A",
+ "Detach Corr", self.rho[1] * 100 if self.rho[1] else "N/A"],
["Delta", self.delta, "Gamma", self.gamma]]
format_strings = [[None, '{:,.0f}', None, '{:,.4f}%'],
[None, '{:.2f}', None, '{:,.2f}'],
@@ -260,7 +261,7 @@ class DualCorrTranche():
with conn.cursor() as c:
c.execute(sql_string, (self.index_type, self.series,
self.tenor, self.value_date,
- self.attach, self.attach))
+ self.detach, self.attach))
if self.attach == 0:
self.rho[1], = next(c)
elif self.detach == 100: