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
Labels
bug
Something isn't working
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])
The text was updated successfully, but these errors were encountered: