python3安装lifelines

目录

一、环境

二、安装lifelines

出现问题

三、测试导入

一、环境:

jupyter notebook中新建ipynb文件

二、安装lifelines
复制代码
pip install --upgrade --no-deps git+https://github.com/CamDavidsonPilon/lifelines.git
出现问题:

缺少模块autograd、formulaic、autograd_gamma

①安装autograd

包名首字母要大写。

python 复制代码
pip install Autograd

②安装formulaic

复制代码
pip install formulaic

下载比较慢,容易报错超时,过一会再运行

③安装autograd_gamma

python 复制代码
pip install autograd_gamma
三、测试导入
python 复制代码
from lifelines import KaplanMeierFitter, CoxPHFitter        
from lifelines.statistics import logrank_test, multivariate_logrank_test 
相关推荐
卷无止境3 分钟前
mathmodel-figure-templates 以及两个上手案例
后端·python
锋行天下1 小时前
服务器 Python 2.7 装不了 langgraph-cli?用本地生成 Dockerfile 曲线救国
人工智能·后端·python
一条大祥脚1 小时前
深入理解 PyTorch FlexAttention:从 Score Mod 到 Mask Mod 的稀疏加速之道
人工智能·pytorch·python·注意力机制·flex attention·可编程注意力
2601_967980112 小时前
Python自动化办公:模块、库与样式调整教程
python·excel·自动化办公·openpyxl·样式调整
长沙三为智能科技2 小时前
GEO与传统SEO的5个关键差异:排名与被引用、关键词与答案型的全维度对比
python·aigc·seo·ai搜索·geo优化
量化分析码农4 小时前
【Python量化趋势跟踪实战 02】突破买入总被假突破坑:通道系统与入场时机
python
Agent世界4 小时前
多平台登录态巡检:cookie 判据为什么会撒谎
python
量化分析码农5 小时前
【Python量化趋势跟踪实战 01】均线多头排列就是趋势开始吗:过滤与确认
python
用户298698530145 小时前
Python 实战:把代码写入 Word 文档的两种实现方式
后端·python·api
小小张说故事5 小时前
Python 里 pickle 到底存了什么:拆开 __reduce__、__getstate__ 和那串能执行代码的字节码
python