Skip to content

Instantly share code, notes, and snippets.

@romanmichaelpaolucci
Last active January 25, 2024 13:50
Show Gist options
  • Save romanmichaelpaolucci/f2ac10d6ae4180a09e2fccf7abcce72f to your computer and use it in GitHub Desktop.
Save romanmichaelpaolucci/f2ac10d6ae4180a09e2fccf7abcce72f to your computer and use it in GitHub Desktop.
def get_latest_highest(stock, comp, year):
return get_exec_comp(stock)[get_exec_comp(stock)['year'] == year].drop_duplicates("nameAndPosition").sort_values(by=comp, ascending=False).iloc[0]
fr = []
p = []
stock_comp = []
total_comp = []
for ticker in r_2021['Adj Close'].reset_index()['index'].values:
fr.append(r_2021['Adj Close'][ticker])
p.append(p_2021['Adj Close'][ticker])
stock_comp.append(get_latest_highest(ticker, 'stock_award', 2021)['stock_award'])
total_comp.append(get_latest_highest(ticker, 'total', 2021)['total'])
print('Done!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment