kaplan_meier_fitter: RuntimeWarning: divide by zero encountered in log
See original GitHub issueWhen I try to calculate KM for
T = [0, 3.5232, 3, 2, 1, 2]
E = [1, 1, 0, 0, 1, 1]
I read the following warning:
.../kaplan_meier_fitter.py:97: RuntimeWarning: divide by zero encountered in log
return (np.log(population - deaths) - np.log(population))
Are there any consequence and is there a way to fix?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
RuntimeWarning: divide by zero encountered in log
I solved this by finding the lowest non-zero number in the array and replacing all zeroes by a number lower than the lowest...
Read more >gamma_gamma_fitter.py:66: RuntimeWarning: divide by zero ...
@CamDavidsonPilon I am running into same RuntimeWarning: divide by zero encountered in log even though my data is filtered for frequency > 0...
Read more >How to troubleshoot "RuntimeWarning: divide by zero ...
Hi all, I am running a Hierarchical Model defined as: where the objective is to estimate, from multinomial counts (k classes) in b...
Read more >lifelines Documentation - Read the Docs
Traditionally, survival analysis was developed to measure lifespans of individuals. An actuary or health professional.
Read more >KaplanMeierFitter — lifelines 0.27.4 documentation
The lower and upper confidence intervals for the survival function. An alias of confidence_interval_ . Uses Greenwood's Exponential formula (“log-log” in R) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
shoot, hm, let me get this fixed asap
Hey there, I actually fixed that in a recent change, but I have not released a new cut. One second…
Okay, I cut a new release, 0.9.3.1, that handles these warnings (they are harmless btw)