python求经验分布斜率
时间: 2023-02-08 16:54:42 浏览: 218
在 Python 中求经验分布斜率可以使用线性回归算法,如 `scipy.stats.linregress`。
首先要导入这个模块
```python
from scipy.stats import linregress
```
然后对于一组 x,y 数据,可以调用 linregress 函数计算斜率和截距。
```python
slope, intercept, r_value, p_value, std_err = linregress(x, y)
```
其中 slope 就是斜率.
更多可以参考 scipy 官网文档 https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html
阅读全文
相关推荐












