diff options
Diffstat (limited to 'python/collateral/jpm.py')
| -rw-r--r-- | python/collateral/jpm.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/python/collateral/jpm.py b/python/collateral/jpm.py index 242030e2..c5ff41ee 100644 --- a/python/collateral/jpm.py +++ b/python/collateral/jpm.py @@ -85,17 +85,16 @@ def download_files(em, count=20, *, fund="BowdSt", **kwargs): def collateral(d, dawn_trades, *, fund="BowdSt", **kwargs): try: + excel_file = load_file(d, fund, ext="xls") df = pd.read_excel( - load_file(d, fund, ext="xls"), + excel_file, sheet_name="Open Positions", skiprows=14, skipfooter=13, ) - breakpoint() df["Deal ID"] = "810RI" + df["Deal ID"].str.extract(r"([^-]*)-.*") - collat = pd.read_excel( - load_file(d, fund, ext="xls"), sheet_name="Collateral Holdings" - ).iloc[-1][-1] + collat_df = pd.read_excel(excel_file, sheet_name="Collateral Holdings") + collat = collat_df.iloc[-1][-1] except StopIteration: # PDF method pdf_file = load_file(d, fund) pages = load_pdf(pdf_file, pages=True) |
