aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/collateral/baml_isda.py11
-rw-r--r--python/collateral/bnp.py9
-rw-r--r--python/collateral/citi.py9
-rw-r--r--python/collateral/cs.py9
-rw-r--r--python/collateral/gs.py9
-rw-r--r--python/collateral/jpm.py9
-rw-r--r--python/collateral/ms.py9
7 files changed, 8 insertions, 57 deletions
diff --git a/python/collateral/baml_isda.py b/python/collateral/baml_isda.py
index effc3c1c..938481fd 100644
--- a/python/collateral/baml_isda.py
+++ b/python/collateral/baml_isda.py
@@ -123,7 +123,7 @@ def load_excel(fname):
rows = []
while s.cell(i, 0).ctype != xlrd.XL_CELL_DATE:
content = s.cell(i, 0).value
- if content.startswith('NOP'):
+ if content.startswith("NOP"):
break
if (
content == ""
@@ -201,13 +201,6 @@ def collateral(d, dawn_trades, *, fund="Serenitas", **kwargs):
df.columns = ["Strategy", "Amount", "Currency"]
df.Amount *= -1
df.loc[df.Strategy == "M_CSH_CASH", "Strategy"] = "TCSH"
- df = df.append(
- {
- "Strategy": "M_CSH_CASH",
- "Amount": -collateral - df.Amount.sum(),
- "Currency": "USD",
- },
- ignore_index=True,
- )
+ df.loc[len(df.index)] = ["M_CSH_CASH", -collateral - df.Amount.sum(), "USD"]
df["date"] = d
return df.set_index("Strategy")
diff --git a/python/collateral/bnp.py b/python/collateral/bnp.py
index d9f2d107..87b3be5c 100644
--- a/python/collateral/bnp.py
+++ b/python/collateral/bnp.py
@@ -58,13 +58,6 @@ def collateral(
df = df.reset_index()
df.columns = ["Strategy", "Amount", "Currency"]
df.Amount *= -1
- df = df.append(
- {
- "Strategy": "M_CSH_CASH",
- "Amount": collateral - df.Amount.sum(),
- "Currency": "USD",
- },
- ignore_index=True,
- )
+ df.loc[len(df.index)] = ["M_CSH_CASH", collateral - df.Amount.sum(), "USD"]
df["date"] = d
return df.set_index("Strategy")
diff --git a/python/collateral/citi.py b/python/collateral/citi.py
index bac10750..e9acfa88 100644
--- a/python/collateral/citi.py
+++ b/python/collateral/citi.py
@@ -87,13 +87,6 @@ def collateral(d, dawn_trades, **kwargs):
df = df.reset_index()
df.columns = ["Strategy", "Amount", "Currency"]
df.Amount *= -1
- df = df.append(
- {
- "Strategy": "M_CSH_CASH",
- "Amount": collat - df.Amount.sum(),
- "Currency": "USD",
- },
- ignore_index=True,
- )
+ df.loc[len(df.index)] = ["M_CSH_CASH", collat - df.Amount.sum(), "USD"]
df["date"] = d
return df.set_index("Strategy")
diff --git a/python/collateral/cs.py b/python/collateral/cs.py
index ad36151c..c1f5c997 100644
--- a/python/collateral/cs.py
+++ b/python/collateral/cs.py
@@ -145,13 +145,6 @@ def collateral(d, dawn_trades, *, fund="Serenitas", **kwargs):
df = df.groupby(["folder", "Currency"], as_index=False).sum()
df = df.rename(columns={"folder": "Strategy"})
df.Amount *= -1
- df = df.append(
- {
- "Strategy": "M_CSH_CASH",
- "Amount": -collateral - df.Amount.sum(),
- "Currency": "USD",
- },
- ignore_index=True,
- )
+ df.loc[len(df.index)] = ["M_CSH_CASH", -collateral - df.Amount.sum(), "USD"]
df["date"] = d
return df.set_index("Strategy")
diff --git a/python/collateral/gs.py b/python/collateral/gs.py
index e2988104..20b34ef2 100644
--- a/python/collateral/gs.py
+++ b/python/collateral/gs.py
@@ -59,13 +59,6 @@ def collateral(d, dawn_trades, *, fund="Serenitas", **kwargs):
df = df.reset_index()
df.columns = ["Strategy", "Amount", "Currency"]
df.Amount *= -1
- df = df.append(
- {
- "Strategy": "M_CSH_CASH",
- "Amount": -collateral - df.Amount.sum(),
- "Currency": "USD",
- },
- ignore_index=True,
- )
+ df = df.loc[len(df.index)] = ["M_CSH_CASH", -collateral - df.Amount.sum(), "USD"]
df["date"] = d
return df.set_index("Strategy")
diff --git a/python/collateral/jpm.py b/python/collateral/jpm.py
index 03ab5c4e..84fff107 100644
--- a/python/collateral/jpm.py
+++ b/python/collateral/jpm.py
@@ -92,13 +92,6 @@ def collateral(d, dawn_trades, *, fund="BowdSt", **kwargs):
df["Currency"] = "USD"
df = df.reset_index()
df.columns = ["Strategy", "Amount", "Currency"]
- df = df.append(
- {
- "Strategy": "M_CSH_CASH",
- "Amount": -collat - df.Amount.sum(),
- "Currency": "USD",
- },
- ignore_index=True,
- )
+ df.loc[len(df.index)] = ["M_CSH_CASH", -collat - df.Amount.sum(), "USD"]
df["date"] = d
return df.set_index("Strategy")
diff --git a/python/collateral/ms.py b/python/collateral/ms.py
index 3a6e1ea8..28909ae3 100644
--- a/python/collateral/ms.py
+++ b/python/collateral/ms.py
@@ -72,13 +72,6 @@ def collateral(d, dawn_trades, *, fund="Serenitas", **kwargs):
df = df.reset_index()
df.columns = ["Strategy", "Amount", "Currency"]
df.loc[df.Strategy == "TCSH", "Amount"] -= fx_ia
- df = df.append(
- {
- "Strategy": "M_CSH_CASH",
- "Amount": -collat - df.Amount.sum(),
- "Currency": "USD",
- },
- ignore_index=True,
- )
+ df.loc[len(df.index)] = ["M_CSH_CASH", -collat - df.Amount.sum(), "USD"]
df["date"] = d
return df.set_index("Strategy")