aboutsummaryrefslogtreecommitdiffstats
path: root/python/load_globeop_report.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/load_globeop_report.py')
-rw-r--r--python/load_globeop_report.py30
1 files changed, 25 insertions, 5 deletions
diff --git a/python/load_globeop_report.py b/python/load_globeop_report.py
index f4598fe3..ac64b936 100644
--- a/python/load_globeop_report.py
+++ b/python/load_globeop_report.py
@@ -32,6 +32,7 @@ def read_valuation_report(f):
df["KnowledgeDate"] = date
df["PeriodEndDate"] = date - bus_day
df["row"] = df.index
+ df["Fund"] = df.Fund.str.replace("BOS_PAT_BOWDOIN", "BOWDST")
if "AccountingPeriod" in df:
del df["AccountingPeriod"]
if "CounterParty" in df:
@@ -40,12 +41,23 @@ def read_valuation_report(f):
df.counterparty = df.counterparty.str.replace("BARC$", "BARCNY", regex=True)
if "Strat" in df:
df.Strat = df.Strat.str.replace(
- "^(SERCGMAST__){1,2}(M_|SER_)?", "", 1, regex=True
+ "^(SERCGMAST__|BOS_PAT_BOWDOIN__){1,2}(M_|SER_)?", "", 1, regex=True
)
- df = df.replace({"Strat": {"TCDSCSH": "TCSH", "MTG_CRT_LD": "CRT_LD"}})
if "Port" in df:
df.Port = df.Port.str.replace(
- "^(SERCGMAST__){1,2}(SERG__|SERG_)?", "", 1, regex=True
+ "^(SERCGMAST__|BOS_PAT_BOWDOIN__){1,2}(SERG__|SERG_)?", "", 1, regex=True
+ )
+ df.Port = (
+ df.Port.str.replace("CLOS", "CLO")
+ .replace("HEDGE_CLO", "CLO")
+ .replace("HEDGE_MBS", "MORTGAGES")
+ )
+ if "counterparty" in df:
+ df.counterparty = (
+ df.counterparty.str.replace("MSCILN", "MSCSNY")
+ .replace("GOLINY", "GOLDNY")
+ .replace("BOANNY", "BAMSNY")
+ .replace("CSITLN", "CSFBBO")
)
df.columns = df.columns.str.lower()
return df
@@ -64,12 +76,20 @@ def valuation_reports():
def read_pnl_report(f):
df = pd.read_csv(f)
- df.Strat = df.Strat.str.replace("^(SERCGMAST__){1,2}(M_|SER_)?", "", 1, regex=True)
+ df.Strat = df.Strat.str.replace(
+ "^(SERCGMAST__|BOS_PAT_BOWDOIN__){1,2}(M_|SER_)?", "", 1, regex=True
+ )
df = df.replace({"Strat": {"TCDSCSH": "TCSH", "MTG_CRT_LD": "CRT_LD"}})
df.Port = df.Port.str.replace(
- "^(SERCGMAST__){1,2}(SERG__|SERG_)?", "", 1, regex=True
+ "^(SERCGMAST__|BOS_PAT_BOWDOIN__){1,2}(SERG__|SERG_)?", "", 1, regex=True
+ )
+ df.Port = (
+ df.Port.str.replace("CLOS", "CLO")
+ .replace("HEDGE_CLO", "CLO")
+ .replace("HEDGE_MBS", "MORTGAGES")
)
df["LongShortIndicator"] = df["LongShortIndicator"].str.strip()
+ df["Fund"] = df.Fund.str.replace("BOS_PAT_BOWDOIN", "BOWDST")
df.columns = df.columns.str.lower().str.replace(" ", "")
return df