首页 > 解决方案 > 如何从 github 安装模块?

问题描述

import sys
sys.path.append('05_com')
from BSM_option_valuation import BSM_call_value

def d1f(St, K, t, T, r, sigma):

    ''' Black-Scholes-Merton d1 function.
    Parameters see e.g. BSM_call_value function. '''

 d1 = (math.log(St / K) + (r + 0.5 * sigma ** 2)
        * (T - t)) / (sigma * math.sqrt(T - t))
return d1

我正在学习绘制 BSM 图(Black-Scholes-Merton 模型),但是,我不太确定如何安装在 github 中上传的模块。请寻求任何建议。

链接:https ://github.com/buswedg/MSPA/blob/master/PREDICT%20400/Weekly%20Discussion/W6%20Derivates/BSM_option_valuation.py

标签: pythonpython-3.xmodule

解决方案


进入那个特定的 Github 存储库。点击选项“代码”,然后复制网址。之后来到你的终端并写

git clone <copied url>

推荐阅读