... the roles correctly when advisors have multiple roles?
I'm trying to obtain a list of advisors and their roles in M&A deals. I have code to pull the deals, but the advisors and the roles come in a concatenated field. Some advisors have multiple roles. If the first advisor has two roles and the second advisor has one role, how can I be sure to assign the roles correctly?
In the Screener App in Eikon, I can change the setting to display managers as row. Can I create a pandas DataFrame through the API to replicate that option?
For example:
Advisor Names:
'BNP Paribas SA|UBS Investment Bank|Nordea'
are associated with the following roles:
'Advisory|Advisory|Arranged Financing|Advisory'. In this case, how could I be sure which advisor arranged financing?
Here's the code I have to pull the deals:
df = pd.DataFrame()
errs = []
for y in range(1980,2023):
print(f'processing {y} ..............')
deal,err = ek.get_data("SCREEN(U(IN(DEALS)),BETWEEN(TR.MnAAnnDate,"+str(y)+"0101,"+str(y)+"1231))",
fields = ["TR.MnASDCDealNumber","TR.MnADealValue(Scale=9)","TR.MnAAnnDate",
"TR.MnAAcquirorFinAdvisor(Concat='|')","TR.MnAAcquirorFinAdvisorParentLong(Concat='|')",
"TR.MnAAcquirorFinRole(Concat='|')"])
errs.append(err)
if deal is None:
print(f'no data for {y} ..............')
continue
# remove deal values with <NA>
deal = deal[(deal['Deal Value'].notna())]
# remove deals with no financial advisors
deal = deal[(deal['Acquiror Financial Advisors Name'].notna())]
df = pd.concat([df,deal],ignore_index=True)