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

The error "ZeroDivisionError: float division by zero" in cathie_wood.py indicates that the R&D expenses for a company (likely KO - Coca-Cola) were zero at the start, causing the division operation to fail. #132

Open
blinkeematt opened this issue Mar 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@blinkeematt
Copy link

Edit cathie_wood.py in line 258 to avoid division by zero:

Replace:
rd_growth = (rd_expenses[-1] - rd_expenses[0]) / abs(rd_expenses[0])

if rd_expenses[0] == 0:
rd_growth = 0 # Avoid division by zero
else:
rd_growth = (rd_expenses[-1] - rd_expenses[0]) / abs(rd_expenses[0])

@blinkeematt blinkeematt added the bug Something isn't working label Mar 6, 2025
@uuu4
Copy link

uuu4 commented Mar 11, 2025

Hi, is it still open? If so, can i send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants