Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fund_top_holdings mixes results #291

Open
phoenix84pl opened this issue Oct 9, 2024 · 0 comments
Open

fund_top_holdings mixes results #291

phoenix84pl opened this issue Oct 9, 2024 · 0 comments

Comments

@phoenix84pl
Copy link

Describe the bug
When you download more tickers and some tickers are not ETFs (so do not have holdings), Dataframe with a result attach further holdings to previous tickers

To Reproduce
Steps to reproduce the behavior:
tickers: SCHD, AAPL, SPY, MSFT, QQQ
result of fund_top_holdings (looks like MSFT has holdings)

/usr/local/lib/python3.10/dist-packages/yahooquery/ticker.py:143: FutureWarning: The behavior of pd.concat with len(keys) != len(objs) is deprecated. In a future version this will raise instead of truncating to the smaller of the two sequences
df = pd.concat(
symbol holdingName holdingPercent
symbol row
SPY 0 AAPL Apple Inc 0.072550
1 MSFT Microsoft Corp 0.065502
2 NVDA NVIDIA Corp 0.061181
3 AMZN Amazon.com Inc 0.035645
4 META Meta Platforms Inc Class A 0.025613
5 GOOGL Alphabet Inc Class A 0.019901
6 BRK-B Berkshire Hathaway Inc Class B 0.017267
7 GOOG Alphabet Inc Class C 0.016446
8 AVGO Broadcom Inc 0.016445
9 TSLA Tesla Inc 0.014867
MSFT 0 HD The Home Depot Inc 0.042606
1 VZ Verizon Communications Inc 0.042086
2 CSCO Cisco Systems Inc 0.041486
3 BLK BlackRock Inc 0.041464
4 TXN Texas Instruments Inc 0.039868
5 PFE Pfizer Inc 0.039848
6 CVX Chevron Corp 0.039825
7 BMY Bristol-Myers Squibb Co 0.039628
8 LMT Lockheed Martin Corp 0.039401
9 KO Coca-Cola Co 0.038476
SCHD 0 AAPL Apple Inc 0.090193
1 MSFT Microsoft Corp 0.081431
2 NVDA NVIDIA Corp 0.075843
3 AVGO Broadcom Inc 0.052568
4 META Meta Platforms Inc Class A 0.050655
5 AMZN Amazon.com Inc 0.049790
6 TSLA Tesla Inc 0.032210
7 COST Costco Wholesale Corp 0.025845
8 GOOGL Alphabet Inc Class A 0.024740
9 GOOG Alphabet Inc Class C 0.023773

Expected behavior
No holdings = Nan or False

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version not known :/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant