Created
September 25, 2020 18:49
-
-
Save ochsec/1f06aca33e4187a94f30695df376ee7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| df.sort_values(by='YTDchange', inplace=True) | |
| output = [] | |
| for index in range(10): | |
| company = df.iloc[[index]] | |
| est = estimates.get_stock_estimates(company['Symbol'].values[0]) | |
| recs = est['recommendations'][0] | |
| targets = est['price_target'] | |
| row = [ | |
| company['Symbol'].values[0], | |
| company['Company'].values[0], | |
| company['Price'].values[0], | |
| company['YTDchange'].values[0], | |
| recs['strongBuy'] + recs['buy'], | |
| recs['hold'], | |
| recs['sell'] + recs['strongSell'], | |
| targets['targetHigh'], | |
| targets['targetMean'], | |
| targets['targetLow'], | |
| targets['lastUpdated'], | |
| ] | |
| output.append(row) | |
| tt.print(output, header=[ | |
| 'Symbol', | |
| 'Company', | |
| 'Price', | |
| 'YTDchange', | |
| 'Buy', | |
| 'Hold', | |
| 'Sell', | |
| 'Target High', | |
| 'Target Mean', | |
| 'Target Low', | |
| 'Last Updated' | |
| ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment