question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

kaplan_meier_fitter: RuntimeWarning: divide by zero encountered in log

See original GitHub issue

When 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:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
CamDavidsonPiloncommented, Nov 8, 2016

shoot, hm, let me get this fixed asap

1reaction
CamDavidsonPiloncommented, Nov 8, 2016

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found