diff options
Diffstat (limited to 'python/collateral/wells.py')
| -rw-r--r-- | python/collateral/wells.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/python/collateral/wells.py b/python/collateral/wells.py index 8ae1f532..3603bbe9 100644 --- a/python/collateral/wells.py +++ b/python/collateral/wells.py @@ -101,7 +101,7 @@ def collateral(d, positions, engine): df.index.names = ["security_id", "maturity"] compare_notionals(df, positions, "Wells") positions = positions.join(df, how="left") - positions["amount"] = positions["notional"] * positions["DIRTYUPFRONT"] + positions["Amount"] = positions["notional"] * positions["DIRTYUPFRONT"] positions.folder = positions.folder.replace( { "HEDGE_MBS": "MBSCDSCSH", @@ -111,6 +111,7 @@ def collateral(d, positions, engine): "IGOPTDEL": "COCSH", "IGINX": "TCSH", "HYINX": "TCSH", + "XOINX": "TCSH", } ) @@ -123,11 +124,11 @@ def collateral(d, positions, engine): positions.folder = positions.apply(aux, axis=1) df = ( - positions.groupby("folder") - .agg({"amount": "sum", "currency": "first"}) - .reset_index("folder") + positions.groupby(["folder", "currency"]) + .agg({"Amount": "sum"}) + .reset_index(["folder", "currency"]) ) - df.columns = ["Strategy", "Amount", "Currency"] + df = df.rename(columns={"folder": "Strategy", "currency": "Currency"}) df_margin = pd.read_csv( DAILY_DIR / "Wells_reports" |
