aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/collateral/wells.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/collateral/wells.py b/python/collateral/wells.py
index 95fbfe50..8ae1f532 100644
--- a/python/collateral/wells.py
+++ b/python/collateral/wells.py
@@ -102,7 +102,7 @@ def collateral(d, positions, engine):
compare_notionals(df, positions, "Wells")
positions = positions.join(df, how="left")
positions["amount"] = positions["notional"] * positions["DIRTYUPFRONT"]
- positions.folder = positions.folder.map(
+ positions.folder = positions.folder.replace(
{
"HEDGE_MBS": "MBSCDSCSH",
"SER_ITRXCURVE": "SER_ITRXCVCSH",
@@ -113,6 +113,15 @@ def collateral(d, positions, engine):
"HYINX": "TCSH",
}
)
+
+ def aux(row):
+ if row.folder == "XCURVE":
+ return "SER_IGCVECSH" if row.currency == "USD" else "SER_ITRXCVCSH"
+ else:
+ return row.folder
+
+ positions.folder = positions.apply(aux, axis=1)
+
df = (
positions.groupby("folder")
.agg({"amount": "sum", "currency": "first"})