NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3117 most downloaded on PyPI
Survival analysis in Python, including Kaplan Meier, Nelson Aalen and regression
Last release 7 months ago
05 Mar 2026
Release timing varies
gaps range from 2 weeks to 1.3 years
Nearly every release is documented
notes for 60 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
13 years old
175 releases · first in 2013
Revoke the 0.30.2 release and republish as 0.30.3.
Revoke the 0.30.1 release and republish as 0.30.2.
Python :: 3 :: Only and add explicit support classifiers for Python 3.12, 3.13, and 3.14.One column per quarter.
Optimize AalenJohansenFitter variance calculation using prefix-sum accumulators; add LinearAccumulator / QuadraticAccumulator utilities and tests.
AalenJohansenFitter variance calculation using prefix-sum accumulators; add LinearAccumulator/QuadraticAccumulator utilities and tests.CoxPHFitter handling when event_col=None (sorting and default event vector).add_at_risk_counts for NumPy >= 2.4 scalar conversion; add regression test.update dependencies (numpy >= 1.14.0)
decimal kwarg not working in StatisticalResultdecimal kwarg not working in StatisticalResultupdate dependencies (pandas >= 2.1)
Fixes bins that are far into the future with using survival_table_from_events , see #1587
survival_table_from_events, see #1587sklean_adaptor. It was a terrible hack, and causing more confusion and support debt than I want. This cleans up our API and simplifies the library. ✨ There's no replacement, and I doubt I'll introduce one ✨Fixed some deprecation warnings
.label property.label propertyEstimators now have .label property
Fixed some deprecation warnings
Pinned to numpy < 2.0
check_assumptions(show_plots=True) will always show plots, regardless of test outcome. Thanks @nomennominatur !
check_assumptions(show_plots=True) will always show plots, regardless of test outcome. Thanks @nomennominatur!lifelines.datasets is now importable.check_assumptions(show_plots=True) will always show plots, regardless of test outcome. Thanks @nomennominatur!
lifelines.datasets is now importable.
- Fix for py3.7
0.27.5 - 2023-04-27 Support pandas 2.0+
0.27.4 - 2022-11-16 New features Support py3.11
Fixed and silenced a lot of warnings
Styler for to_latexto_* on them.Fixed and silenced a lot of warnings
Migrate to newer Pandas Styler for to_latex
There were way too many functions on the summary objects, so I’ve hidden to_* on them.
Fixed issue in add_at_risk_table when there were very late entries.
Fixed issue in add_at_risk_table when there were very late entries.
all fit_ methods now accept a fit_options dict that allows one to pass kwargs to the underlying fitting algorithm.
fit_ methods now accept a fit_options dict that allows one to pass kwargs to the underlying fitting algorithm.step_size is removed from Cox models fit. See fit_options above.all fit_ methods now accept a fit_options dict that allows one to pass kwargs to the underlying fitting algorithm.
step_size is removed from Cox models fit. See fit_options above.
fixed Cox models when “trivial” matrix was passed in (one with no covariates)
Fix late entry in add_at_risk_counts.
Dropping Python3.6 support.
add_at_risk_counts.add_at_risk_counts has a new flag to determine to use start or end-of-period at risk counts.summary that display the number the parameter is being compared against.plot_lifetimes's duration arg has the interpretation of "relative time the subject died (since birth)", instead of the old "time observed for". These interpretations are different when there is late entry.Dropping Python3.6 support.
Fix late entry in add_at_risk_counts.
add_at_risk_counts has a new flag to determine to use start or end-of-period at risk counts.
new column in fitter’s summary that display the number the parameter is being compared against.
plot_lifetimes’s duration arg has the interpretation of “relative time the subject died (since birth)”, instead of the old “time observed for”. These interpretations are different when there is late entry.
adding weights to log rank functions
weights to log rank functionsFix using formulas with CoxPHFitter.score
CoxPHFitter.score#### 0.26.2 - 2021-09-15 Error in v0.26.1 deployment
Error in v0.26.1 deployment
.BIC_ is now present on fitted models.
.BIC_ is now present on fitted models.CoxPHFitter with spline baseline can accept pre-computed knot locations.predict always predicts the survival function (as does every other model), confidence_interval_ is always the CI for the survival function (as does every other model), and so on. In summary: the API for estimates doesn't change depending on what your censoring your dataset is.find_best_parametric_model where the wrong BIC value was being computed.Fix integer-valued categorical variables in regression model predictions.
Fix integer-valued categorical variables in regression model predictions.
numpy > 1.20 is allowed.
Bug fix in the elastic-net penalty for Cox models that wasn’t weighting the terms correctly.
Better appearance when using a single row to show in add_at_risk_table.
add_at_risk_table.Better appearance when using a single row to show in add_at_risk_table.
#### 0.25.9 - 2021-02-04 Small bump in dependencies.
Small bump in dependencies.
Important: we dropped Patsy as our formula framework, and adopted Formulaic. Will the latter is less mature than Patsy, we feel the core capabilities
Important: we dropped Patsy as our formula framework, and adopted Formulaic. Will the latter is less mature than Patsy, we feel the core capabilities are satisfactory and it provides new opportunities.
_scipy_callback function is available to use in fitting algorithms.Adding cumulative_hazard_at_times to NelsonAalenFitter
cumulative_hazard_at_times to NelsonAalenFitterCoxPHFitter when entry time == event time.concordance_index_ when no events observedAdding cumulative_hazard_at_times to NelsonAalenFitter
Fixed error in CoxPHFitter when entry time == event time.
Fixed formulas in AFT interval censoring regression.
Fixed concordance_index_ when no events observed
Fixed label being overwritten in ParametricUnivariate models
0.25.6 - 2020-10-26 New features Parametric Cox models can now handle left and interval censoring datasets. Bug fixes "improved" the output of add_at_
0.25.6 - 2020-10-26 New features Parametric Cox models can now handle left and interval censoring datasets. Bug fixes "improved" the output of add_at_risk_counts by removing a call to plt.tight_layout() - this works better when you are calling add_at_risk_counts on multiple axes, but it is recommended you call plt.tight_layout() at the very end of your script. Fix bug in KaplanMeierFitter's interval censoring where max(lower bound) < min(upper bound).
Parametric Cox models can now handle left and interval censoring datasets.
“improved” the output of add_at_risk_counts by removing a call to plt.tight_layout() - this works better when you are calling add_at_risk_counts on multiple axes, but it is recommended you call plt.tight_layout() at the very end of your script.
Fix bug in KaplanMeierFitter’s interval censoring where max(lower bound) < min(upper bound).
check_assumptions now returns a list of list of axes that can be manipulated
check_assumptions now returns a list of list of axes that can be manipulatedplot_partial_effects with categorical data in AFT modelsweights wasn't being applied properly in NPMLEcheck_assumptions now returns a list of list of axes that can be manipulated
fixed error when using plot_partial_effects with categorical data in AFT models
improved warning when Hessian matrix contains NaNs.
fixed performance regression in interval censoring fitting in parametric models
weights wasn’t being applied properly in NPMLE
New baseline estimator for Cox models: piecewise
piecewiselog_likelihood_ratio_test() and print_summary()check_assumptions when using formulas.New baseline estimator for Cox models: piecewise
Performance improvements for parametric models log_likelihood_ratio_test() and print_summary()
Better step-size defaults for Cox model -> more robust convergence.
fix check_assumptions when using formulas.
survival_difference_at_fixed_point_in_time_test now accepts fitters instead of raw data, meaning that you can use this function on left, right or inte
survival_difference_at_fixed_point_in_time_test now accepts fitters instead of raw data, meaning that you can use this function on left, right or interval censored data.survival_difference_at_fixed_point_in_time_test above.StatisticalResult printing in notebooksplot_covariate_groupsplot_partial_effects_on_outcome.survival_difference_at_fixed_point_in_time_test now accepts fitters instead of raw data, meaning that you can use this function on left, right or interval censored data.
See note on survival_difference_at_fixed_point_in_time_test above.
fix StatisticalResult printing in notebooks
fix Python error when calling plot_covariate_groups
fix dtype mismatches in plot_partial_effects_on_outcome.
Spline CoxPHFitter can now use strata.
CoxPHFitter can now use strata.CoxPHFitter. The linear term in the spline part was moved to a new Intercept term in the beta_.n_baseline_knots in the spline CoxPHFitter now refers to all knots, and not just interior knots (this was confusing to me, the author.). So add 2 to n_baseline_knots to recover the identical model as previously.CoxPHFitter with when predict_hazard was called.CoxPHFitterSpline CoxPHFitter can now use strata.
a small parameterization change of the spline CoxPHFitter. The linear term in the spline part was moved to a new Intercept term in the beta_.
n_baseline_knots in the spline CoxPHFitter now refers to all knots, and not just interior knots (this was confusing to me, the author.). So add 2 to n_baseline_knots to recover the identical model as previously.
fix splines CoxPHFitter with when predict_hazard was called.
fix some exception imports I missed.
fix log-likelihood p-value in splines CoxPHFitter
ok _actually_ ship the out-of-sample calibration code
labels=False in add_at_risk_countsadd_at_risk_countspatsy as a proper dependency.ok actually ship the out-of-sample calibration code
fix labels=False in add_at_risk_counts
allow for specific rows to be shown in add_at_risk_counts
put patsy as a proper dependency.
suppress some Pandas 1.1 warnings.
plot_covariate_groups has been deprecated in favour of plot_partial_effects_on_outcome.
plot_covariate_group now can plot other y-values like hazards and cumulative hazards (default: survival function).CoxPHFitter now accepts late entries via entry_col.calibration.survival_probability_calibration now works with out-of-sample data.print_summary now accepts a column argument to filter down the displayed values. This helps with clutter in notebooks, latex, or on the terminal.add_at_risk_counts now follows the cool new KMunicate suggestions1 as a formula string in the regressors dict). You may also need to remove the T and E columns from regressors. I've updated the models in the \examples folder with examples of this new model building.plot_covariate_groups has been deprecated in favour of plot_partial_effects_on_outcome.plot_covariate_groups has changed from the mean observation (including dummy-encoded categorical variables) to median for ordinal (including continuous) and mode for categorical."_intercept" to when it added a constant column in regressions. To align with Patsy, we are now using "Intercept".ancillary_df kwarg has been renamed to ancillary. This reflects the more general use of the kwarg (not always a DataFrame, but could be a boolean or string now, too).plot_covariate_groups (now called plot_partial_effects_on_outcome) behaves differently for transformed variables. Users no longer need to add "derivatives" features, and encoding is done implicitly. See docs here.lifelines.exceptionsprint_summary logic in IDEs and Jupyter exports. Previously it should not be displayed.SplineFitter. Previously, the "null hypothesis" was no coefficient=0, but coefficient=0.01. This is now set to the former.survival_table_from_events with intervals when no events would occur in a interval.improved algorithm choice for large Dataframes for Cox models. Should see a significant performance boost.
utils.median_survival_time not accepting Pandas Series.improved algorithm choice for large DataFrames for Cox models. Should see a significant performance boost.
fixed utils.median_survival_time not accepting Pandas Series.
fixed an edge case in KaplanMeierFitter where a really late entry would occur after all other population had died.
KaplanMeierFitter where a really late entry would occur after all other population had died.plot in BreslowFlemingtonHarrisFitterconditional_after and times in CoxPHFitter("spline") prediction methods would be ignored.fixed an edge case in KaplanMeierFitter where a really late entry would occur after all other population had died.
fixed plot in BreslowFlemingtonHarrisFitter
fixed bug where using conditional_after and times in CoxPHFitter("spline") prediction methods would be ignored.
fixed a bug where using conditional_after and times in prediction methods would result in a shape error
conditional_after and times in prediction methods would result in a shape errorscore was not able to be used in splined CoxPHFitterprint_summaryfixed a bug where using conditional_after and times in prediction methods would result in a shape error
fixed a bug where score was not able to be used in splined CoxPHFitter
fixed a bug where some columns would not be displayed in print_summary
fixed a bug where CoxPHFitter would ignore inputed alpha levels for confidence intervals
CoxPHFitter would ignore inputed alpha levels for confidence intervalsCoxPHFitter would fail with working with sklearn_adapterfixed a bug where CoxPHFitter would ignore inputed alpha levels for confidence intervals
fixed a bug where CoxPHFitter would fail with working with sklearn_adapter
improved convergence of GeneralizedGamma(Regression)Fitter.
GeneralizedGamma(Regression)Fitter.improved convergence of GeneralizedGamma(Regression)Fitter.
new spline regression model CRCSplineFitter based on the paper "A flexible parametric accelerated failure time model" by Michael J. Crowther, Patrick
CRCSplineFitter based on the paper "A flexible parametric accelerated failure time model" by Michael J. Crowther, Patrick Royston, Mark Clements.lifelines.calibration.survival_probability_calibration to help validate regression models. Based on “Graphical calibration curves and the integrated calibration index (ICI) for survival models” by P. Austin, F. Harrell, and D. van Klaveren.penalizer - we now penalizing everything except intercept terms in linear relationships.New improvements when using splines model in CoxPHFitter - it should offer much better prediction and baseline-hazard estimation, including extrapolat
.summary and .print_summary methods.New improvements when using splines model in CoxPHFitter - it should offer much better prediction and baseline-hazard estimation, including extrapolation and interpolation.
Related to above: the fitted spline parameters are now available in the .summary and .print_summary methods.
fixed a bug in initialization of some interval-censoring models -> better convergence.
Faster NPMLE for interval censored data
logrank_test: wilcoxon, tarone-ware, peto, fleming-harrington. Thanks @sean-reedlifelines.datasets.load_miceplot_loglogs. Thanks @sean-reed!Faster NPMLE for interval censored data
New weightings available in the logrank_test: wilcoxon, tarone-ware, peto, fleming-harrington. Thanks @sean-reed
new interval censored dataset: lifelines.datasets.load_mice
Cleared up some mislabeling in plot_loglogs. Thanks @sean-reed!
tuples are now able to be used as input in univariate models.
Non parametric interval censoring is now available, _experimentally_. Not all edge cases are fully checked, and some features are missing. Try it unde
KaplanMeierFitter.fit_interval_censoringNon parametric interval censoring is now available, experimentally. Not all edge cases are fully checked, and some features are missing. Try it under KaplanMeierFitter.fit_interval_censoring
find_best_parametric_model can handle left and interval censoring. Also allows for more fitting options.
find_best_parametric_model can handle left and interval censoring. Also allows for more fitting options.AIC_ is a property on parametric models, and AIC_partial_ is a property on Cox models.penalizer in all regression models can now be an array instead of a float. This enables new functionality and better
control over penalization. This is similar (but not identical) to penalty.factors in glmnet in R.cdf_plot and qq_plot were not factoring in the weights correctly.At the cost of some performance, convergence is improved in many models.
lifelines.plotting.plot_interval_censored_lifetimes for plotting interval censored data - thanks @sean-reed!cdf_plot and qq_plot were not factoring in the weights correctly.At the cost of some performance, convergence is improved in many models.
New lifelines.plotting.plot_interval_censored_lifetimes for plotting interval censored data - thanks @sean-reed!
fixed bug where cdf_plot and qq_plot were not factoring in the weights correctly.
plot_lifetimes accepts pandas Series.
plot_lifetimes accepts pandas Series.at_risk_counts for subplots.CoxTimeVaryingFitterplot_lifetimes accepts pandas Series.
Fixed important bug in interval censoring models. Users using interval censoring are strongly advised to upgrade.
Improved at_risk_counts for subplots.
More data validation checks for CoxTimeVaryingFitter
Improved stability of interval censoring in parametric models.
ancillary_df works for interval censoring.score works for interval censored modelsImproved stability of interval censoring in parametric models.
setting a dataframe in ancillary_df works for interval censoring
.score works for interval censored models
new logx kwarg in plotting curves
logx kwarg in plotting curvescompute_followup_hazard_ratios for simulating what the hazard ratio would be at previous times. This is useful because the final hazard ratio is some weighted average of these.new logx kwarg in plotting curves
PH models have compute_followup_hazard_ratios for simulating what the hazard ratio would be at previous times. This is useful because the final hazard ratio is some weighted average of these.
Fixed error in HTML printer that was hiding concordance index information.
Fixed bug when no covariates were passed into CoxPHFitter. See #975
CoxPHFitter. See #975StatisticalResult where the test name was not displayed correctly.plot_covariate_groups for parametric models.Fixed bug when no covariates were passed into CoxPHFitter. See #975
Fixed error in StatisticalResult where the test name was not displayed correctly.
Fixed a keyword bug in plot_covariate_groups for parametric models.
Stability improvements for GeneralizedGammaRegressionFitter and CoxPHFitter with spline estimation.
Stability improvements for GeneralizedGammaRegressionFitter and CoxPHFitter with spline estimation.
Fixed bug with plotting hazards in NelsonAalenFitter.
This version and future versions of lifelines no longer support py35. Pandas 1.0 is fully supported, along with previous version. Minimum Scipy has be
This version and future versions of lifelines no longer support py35. Pandas 1.0 is fully supported, along with previous version. Minimum Scipy has been bumped to 1.2.0
CoxPHFitter and CoxTimeVaryingFitter has support for an elastic net penalty, which includes L1 and L2 regression.CoxPHFitter has new baseline survival estimation methods. Specifically, spline now estimates the coefficients and baseline survival using splines. The traditional method, breslow, is still the default however.score method that will score your model against a dataset (ex: a testing or validation dataset). The default is to evaluate the log-likelihood, but also the concordance index can be chose.MixtureCureFitter for quickly creating univariate mixture models.plot_density, density_at_times, and property density_ that computes the probability density function estimates.lifelines.fitters.mixins.ProportionalHazardMixin that implements proportional hazard checks.predict_median, predict_percentile, predict_expectation, predict_log_partial_hazard, and possibly others.score_ on models has been renamed concordance_index_.variance_matrix_ is now a DataFrame.CoxTimeVaryingFitter no longer requires an id_col. It's optional, and some checks may be done for integrity if provided.utils.k_fold_cross_validation.inf from PiecewiseExponentialRegressionFitter.breakpoints and PiecewiseExponentialFitter.breakpointstie_method was dropped from Cox models (it was always Efron anyways...)lifelines.fitters.mixinsfind_best_parametric_model evaluation kwarg has been changed to scoring_method._score_ and path from Cox model.show_censors with KaplanMeierFitter.plot_cumulative_density see issue #940."BIC" code path in find_best_parametric_modellog_likelihood_fixed important error when a parametric regression model would not assign the correct labels to fitted parameters' variances. See more here: https://g
GeneralizedGammaRegressionFitter and any custom regression models should update their code as soon as possible.fixed important error when a parametric regression model would not assign the correct labels to fitted parameters’ variances. See more here: https://github.com/CamDavidsonPilon/lifelines/issues/931. Users of GeneralizedGammaRegressionFitter and any custom regression models should update their code as soon as possible.
fixed important error when a parametric regression model would not assign the correct labels to fitted parameters. See more here: https://github.com/C
GeneralizedGammaRegressionFitter and any custom regression models should update their code as soon as possible.fixed important error when a parametric regression model would not assign the correct labels to fitted parameters. See more here: https://github.com/CamDavidsonPilon/lifelines/issues/931. Users of GeneralizedGammaRegressionFitter and any custom regression models should update their code as soon as possible.
Bug fixes for py3.5. This will be the last version of lifelines that supports Python 3.5.
Bug fixes for py3.5. This will be the last version of lifelines that supports Python 3.5.
New univariate model, SplineFitter, that uses cubic splines to model the cumulative hazard.
SplineFitter, that uses cubic splines to model the cumulative hazard.lifelines.utils.find_best_parametric_model function that will iterate through the models and return the model with the lowest AIC (by default).New predict_hazard for parametric regression models.
predict_hazard for parametric regression models.kwargs is now used in plot_covariate_groupsprint_summary were not being suppressed correctly.New predict_hazard for parametric regression models.
New lymph node cancer dataset, originally from H.F. for the German Breast Cancer Study Group (GBSG) (1994)
fixes error thrown when converge of regression models fails.
kwargs is now used in plot_covariate_groups
fixed bug where large exponential numbers in print_summary were not being suppressed correctly.
- Bug fix for PyPI
StatisticalResult.print_summary supports html output.
StatisticalResult.print_summary supports html output.printer.pyStatisticalResult.print_summary supports html output.
fix import in printer.py
fix html printing with Univariate models.
new lifelines.plotting.rmst_plot for pretty figures of survival curves and RMSTs.
lifelines.plotting.rmst_plot for pretty figures of survival curves and RMSTs.lifelines.utils.resticted_mean_survival_timeprint_summary for AAF class.sklearn_adapter classes.conditional_after in Cox model with strata was used.new lifelines.plotting.rmst_plot for pretty figures of survival curves and RMSTs.
new variance calculations for lifelines.utils.restricted_mean_survival_time
performance improvements on regression models’ preprocessing. Should make datasets with high number of columns more performant.
fixed print_summary for AAF class.
fixed repr for sklearn_adapter classes.
fixed conditional_after in Cox model with strata was used.
new print_summary option style to print HTML, LaTeX or ASCII output
print_summary option style to print HTML, LaTeX or ASCII outputCoxPHFitter - up to 30% performance improvements for some datasets.print_summary for HTML output.__repr__StatisticalResult.print_summaryprint_summary with left censored models.new print_summary option style to print HTML, LaTeX or ASCII output
performance improvements for CoxPHFitter - up to 30% performance improvements for some datasets.
fixed bug where computed statistics were not being shown in print_summary for HTML output.
fixed bug where “None” was displayed in models’ __repr__
fixed bug in StatisticalResult.print_summary
fixed bug when using print_summary with left censored models.
lots of minor bug fixes.
new print_summary abstraction that allows HTML printing in Jupyter notebooks!
print_summary abstraction that allows HTML printing in Jupyter notebooks!summary have changed.ParametricUnivariateFitter name.median_ has been removed in favour of median_survival_time_.left_censorship in fit has been removed in favour of fit_left_censoring.new print_summary abstraction that allows HTML printing in Jupyter notebooks!
silenced some warnings.
The “comparison” value of some parametric univariate models wasn’t standard, so the null hypothesis p-value may have been wrong. This is now fixed.
fixed a NaN error in confidence intervals for KaplanMeierFitter
To align values across models, the column names for the confidence intervals in parametric univariate models summary have changed.
Fixed typo in ParametricUnivariateFitter name.
median_ has been removed in favour of median_survival_time_.
left_censorship in fit has been removed in favour of fit_left_censoring.
The tests were re-factored to be shipped with the package. Let me know if this causes problems.
The tests were re-factored to be shipped with the package. Let me know if this causes problems.
fixed predict_ methods in AFT models when timeline was not specified.
predict_ methods in AFT models when timeline was not specified.qq_plotqth_survival_timeCoxPHFitter now displays correct columns values when changing alpha param.fixed predict_ methods in AFT models when timeline was not specified.
fixed error in qq_plot
fixed error when submitting a model in qth_survival_time
CoxPHFitter now displays correct columns values when changing alpha param.
Your coding agent can read these notes before it upgrades. Set up the MCP server →