使用Pycharm中的生命线绘制KMF曲线退出代码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) 

设法弄明白了!所需plt.show()

最新更新