Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种快速的方法来生成像数据系列这样的随机库存?
我的意思是看起来像股票或温度或季节性图表的数据序列,即不是锯齿状的起伏,而更像是基于时间的曲线。
我编码的一个可能的答案:
def gen(value, steps=10, trend=0, low=-10, high=10): new = value rv = [] for i in range(steps) : new = trend + new + np.random.randint(low,high) rv.append(new) return rv plot(gen(100,steps=50))