aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops/cash.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops/cash.py')
-rw-r--r--python/report_ops/cash.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/report_ops/cash.py b/python/report_ops/cash.py
index 39044a0d..63b43bbe 100644
--- a/python/report_ops/cash.py
+++ b/python/report_ops/cash.py
@@ -127,12 +127,12 @@ class BNYCashReport(
def to_db(self):
p = super().to_db("Live-cash")
df = pd.read_csv(p)
- df["Beginning Balance Local"] = (
- df["Beginning Balance Local"]
- .str.replace("(", "-")
- .str.replace("[),]", "", regex=True)
+ df["Beginning Balance Local"] = df["Beginning Balance Local"].apply(
+ lambda s: "-" + s[1:-1] if s.startswith("(") else s
+ )
+ df["Beginning Balance Local"] = pd.to_numeric(
+ df["Beginning Balance Local"].str.replace(",", "")
)
- df = df.astype({"Beginning Balance Local": "float64"})
for row in (
df.groupby(["Account Number", "Local Currency Code"])
.sum()["Beginning Balance Local"]