0

抱歉,我对此很陌生,但我尝试运行一些代码,我得到退出代码 0(没有错误),但我没有看到任何输出(在 Python 控制台中)我正在使用带有生命线包的 PyCharm Python 3.7

from lifelines import KaplanMeierFitter

durations = [5,6,6,2.5,4,4]
event_observed = [1, 0, 0, 1, 1, 1]

## create a kmf object
kmf = KaplanMeierFitter()

## Fit the data into the model
kmf.fit(durations, event_observed,label='Kaplan Meier Estimate')

## Create an estimate
kmf.plot(ci_show=False) 
4

1 回答 1

0

设法弄清楚了!需要plt.show()

于 2020-04-19T02:59:41.493 回答