1 Star 0 Fork 0

故事里的大魔王/数据分析

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
股票的蒙特卡洛模拟.py 476 Bytes
一键复制 编辑 原始数据 按行查看 历史
故事里的大魔王 提交于 2023-06-12 21:53 +08:00 . 数据分析
import random
import matplotlib.pyplot as plt
from scipy import stats
def roll(init, counts):
init_value = init
counts = counts
num = 1
x = []
y = []
choice = stats.norm(0.01, 0.05).rvs(100)
while num <= counts:
factor = 1 + random.choice(choice)
init_value *= factor
x.append(num)
num += 1
y.append(init_value)
plt.plot(x, y)
if __name__ == '__main__':
for i in range(20):
roll(100, 100)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yu_fengguang/data-analysis.git
[email protected]:yu_fengguang/data-analysis.git
yu_fengguang
data-analysis
数据分析
master

搜索帮助