fix pd warnings
@@ -265,7 +265,7 @@ def _expected_value_of_survival_up_to_t(model_or_survival_function, t: float = n
ApproximationWarning,
)
sf = model_or_survival_function.loc[:t]
- sf = sf.append(pd.DataFrame([1], index=[0], columns=sf.columns)).sort_index()
+ sf = pd.concat((sf, pd.DataFrame([1], index=[0], columns=sf.columns))).sort_index()
return trapz(y=sf.values[:, 0], x=sf.index)
elif isinstance(model_or_survival_function, lifelines.fitters.UnivariateFitter):
# lifelines model
@@ -273,7 +273,7 @@ def _expected_value_of_survival_up_to_t(model_or_survival_function, t: float = n
# if KM, we can compute exactly
if isinstance(model, lifelines.KaplanMeierFitter):
sf = model.survival_function_.loc[:t]
- sf = sf.append(pd.DataFrame([model.predict(t)], index=[t], columns=sf.columns)).sort_index()
+ sf = pd.concat((sf, pd.DataFrame([model.predict(t)], index=[t], columns=sf.columns))).sort_index()
sf = sf.reset_index()
return (sf["index"].diff().shift(-1) * sf[model._label]).sum()
else:
