last indexer change

This commit is contained in:
Pietro Rodolfo Masera 2023-06-01 14:20:10 +02:00
parent 6b93623c6d
commit cbf243f252
1 changed files with 4 additions and 2 deletions

View File

@ -83,9 +83,11 @@ def employees_over_time(ticker: str):
def past_performance_earnings(ticker: str):
earnings = pd.read_csv(f'Companies_Data/{ticker}_Data/{ticker}earnings.csv', index_col=[0]) # Read earnings csv
earnings = pd.read_csv(f'Elaborated_Data/eps_comparison.csv', index_col=[0]) # Read earnings csv
performance_index = round((earnings['epsActual'].sum() - earnings['epsEstimate'].sum()) / earnings['epsEstimate'].sum() * 100, 2) #Performance
selected_rows = earnings[earnings['Ticker'] == ticker] # Select rows with ticker
# performance_index = round(((earnings['epsActual'].sum() - earnings['epsEstimate'].sum()) / earnings['epsEstimate'].sum() * 100, 2) #Performance
performance_index = selected_rows['epsDifferential'].mean()
return performance_index