Last active
October 27, 2021 23:34
-
-
Save marcosan93/5b0a86ce64e20afbd051e14bbe085cc0 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
| def getMultipleFunds(tickers, api_token): | |
| """ | |
| Gets fundamental data from multiple stock tickers given as a list. Returns | |
| a large dataframe containing the concatenated information for all the given | |
| tickers. | |
| """ | |
| # Verifying if the list of tickers is compatible | |
| available = client.get_exchange_symbols("US") | |
| available = set(i['Code'] for i in available) | |
| tickers = [i for i in tickers if i in available] | |
| # If no valid tickers | |
| if len(tickers)==0: | |
| return "No valid tickers found." | |
| # Iterating through the tickers | |
| dfs = {} | |
| for ticker in tickers: | |
| dfs[ticker] = formatFundamentals(ticker) | |
| return pd.concat(dfs, axis=0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment