aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/load_globeop_report.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/python/load_globeop_report.py b/python/load_globeop_report.py
index c7f6cf18..03806f12 100644
--- a/python/load_globeop_report.py
+++ b/python/load_globeop_report.py
@@ -37,12 +37,16 @@ def read_valuation_report(f):
if "CounterParty" in df:
del df["CounterParty"]
df = df.rename(columns={"CounterPartyCode": "counterparty"})
- df.counterparty = df.counterparty.str.replace("BARC$", "BARCNY")
+ 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)
+ df.Strat = df.Strat.str.replace(
+ "^(SERCGMAST__){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)
+ df.Port = df.Port.str.replace(
+ "^(SERCGMAST__){1,2}(SERG__|SERG_)?", "", 1, regex=True
+ )
df.columns = df.columns.str.lower()
return df