diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/collateral/baml_fcm.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/collateral/baml_fcm.py b/python/collateral/baml_fcm.py index 8a175a51..0bcccd73 100644 --- a/python/collateral/baml_fcm.py +++ b/python/collateral/baml_fcm.py @@ -48,7 +48,10 @@ def collateral(d, positions, engine): df["DIRTYUPFRONT"] = (df.MTM + df.ACCRUEDCPN) / df.NOTIONAL df.index.names = ["security_id", "maturity"] # dropped old versions (trades should be offsetting - df = df[df.groupby(["security_id", "maturity"])["NOTIONAL"].sum() != 0.0] + df = df.groupby(level=["security_id", "maturity"]).agg( + {"NOTIONAL": "sum", "DIRTYUPFRONT": "first"} + ) + df = df[df.NOTIONAL != 0.0] compare_notionals(df, positions, "BAML") positions["dirtyupfront"] = df.reindex(positions.index)["DIRTYUPFRONT"] positions["Amount"] = positions["notional"] * positions["dirtyupfront"] |
