aboutsummaryrefslogtreecommitdiffstats
path: root/python/load_globeop_report.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/load_globeop_report.py')
-rw-r--r--python/load_globeop_report.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/python/load_globeop_report.py b/python/load_globeop_report.py
index 5ea765a7..01ffb5a7 100644
--- a/python/load_globeop_report.py
+++ b/python/load_globeop_report.py
@@ -21,7 +21,7 @@ def get_globs(fname, years=['2013', '2014', '2015', '2016', '2017']):
def read_valuation_report(f):
date = pd.Timestamp(f.rsplit('/', 3)[1])
if date >= pd.Timestamp('2013-02-06'):
- df = pd.read_csv(f, parse_dates=['KnowledgeDate','PeriodEndDate'])
+ df = pd.read_csv(f, parse_dates=['KnowledgeDate', 'PeriodEndDate'])
else:
df = pd.read_csv(f)
df['KnowledgeDate'] = date
@@ -81,8 +81,9 @@ def read_cds_report(f, old_report=False):
'Last Modified Date', 'Fund Long Name', 'Instrument Sub Type',
'Netting Id', 'Client', 'Trade Status', 'Position Status',
'Clearing Broker', 'Settle Mode', 'Off Price', 'On Price',
- 'Price Ccy', 'VAT', 'SEC Fee', 'Clearing Fee', 'Remaining Notional',
- 'Trading Notional'], axis=1, errors='ignore')
+ 'Price Ccy', 'VAT', 'SEC Fee', 'Clearing Fee',
+ 'Remaining Notional', 'Trading Notional', 'BBGID'],
+ axis=1, errors='ignore')
df.columns = df.columns.str.lower().str.replace(" ", "_")
if old_report:
df.calendar = df.calendar.str.replace(" ", "")
@@ -90,14 +91,14 @@ def read_cds_report(f, old_report=False):
df.roll_convention = df.roll_convention.str.title()
df = df[df.strategy != 'SER_TEST']
df.loc[df.strategy == 'SERCGMAST__MBSCDS', 'strategy'] = 'MBSCDS'
- df.strategy = df.strategy.str.replace("SER_","")
+ df.strategy = df.strategy.str.replace("SER_", "")
df['buy/sell'] = df['buy/sell'].astype('category')
df['buy/sell'].cat.categories = ['Buyer', 'Seller']
df.prime_broker = df.prime_broker.where(df.prime_broker != 'NONE')
df.loc[df.executing_broker.isnull(),'executing_broker'] = df[df.executing_broker.isnull()].counterparty
del df['counterparty']
df = df.rename(columns={'executing_broker': 'counterparty',
- 'independent_%':'independent_perc'})
+ 'independent_%': 'independent_perc'})
return df
def cds_reports():