diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/external_deriv_marks.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/python/external_deriv_marks.py b/python/external_deriv_marks.py index 71c8226b..1087df04 100644 --- a/python/external_deriv_marks.py +++ b/python/external_deriv_marks.py @@ -104,15 +104,18 @@ def citi_navs(date: datetime.date = None, **kwargs): ] df.columns = COLUMNS dfs.append(df) - # there can be multiple files per day, we take the latest one - df = ( - pd.concat(dfs) - .sort_index() - .groupby(level=["Value Date", "Operations File"]) - .last() - ) - # nav is from Citi's point of view - df[["local_nav", "base_nav"]] *= -1.0 + if dfs: + # there can be multiple files per day, we take the latest one + df = ( + pd.concat(dfs) + .sort_index() + .groupby(level=["Value Date", "Operations File"]) + .last() + ) + # nav is from Citi's point of view + df[["local_nav", "base_nav"]] *= -1.0 + else: + df = pd.DataFrame(columns=COLUMNS) return df |
