diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/collateral/wells.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/python/collateral/wells.py b/python/collateral/wells.py index a9cb4b1b..e4176ed0 100644 --- a/python/collateral/wells.py +++ b/python/collateral/wells.py @@ -129,25 +129,27 @@ def collateral(d, positions, engine): .reset_index(["folder", "currency"]) ) df = df.rename(columns={"folder": "Strategy", "currency": "Currency"}) - col_names = ["CURRENCY_NAME", "CURRENT_IM", "VALUE_DATE"] + col_names = ["CURRENCY_NAME", "VALUE_DATE", "CURRENT_IM"] try: df_margin = pd.read_csv( DAILY_DIR / "Wells_reports" / f"OTC_Moneyline_Activity_{account}_{d:%m%d%Y}.csv", usecols=col_names, - parse_dates=[col_names[-1]], + parse_dates=[col_names[1]], index_col=[col_names[0]], ) except ValueError as e: # reports downloaded from the website have Title case column names - col_names = [c.replace("_", "").title() for c in col_names] + col_names = [c.replace("_", " ").title() for c in col_names] + # almost Title case... + col_names[-1] = "Current IM" df_margin = pd.read_csv( DAILY_DIR / "Wells_reports" / f"OTC_Moneyline_Activity_{account}_{d:%m%d%Y}.csv", usecols=col_names, - parse_dates=[col_names[-1]], + parse_dates=[col_names[1]], index_col=[col_names[0]], ) try: |
