以python为单位生成正态分布,numpy

时间:2016-09-24 10:02:22

标签: python numpy normal-distribution

我可以像这样在numpy中生成正态分布的随机样本。

>>> mu, sigma = 0, 0.1 # mean and standard deviation
>>> s = np.random.normal(mu, sigma, 1000)

但显然它们是随机顺序的。如何按顺序生成数字,也就是说,值应该像正常分布一样上升和下降。

换句话说,我想用mu和sigma创建一条曲线(高斯),并输入n个点数。

怎么做?

1 个答案:

答案 0 :(得分:1)

To(1)生成大小为n的x坐标的随机样本(来自正态分布)(2)评估x值处的正态分布(3)将x值按正常大小排序在他们的位置分配,这将成功:

com.google.firebase:firebase-core:9.6.0     Analytics
com.google.firebase:firebase-database:9.6.0     Realtime Database
com.google.firebase:firebase-storage:9.6.0  Storage
com.google.firebase:firebase-crash:9.6.0    Crash Reporting
com.google.firebase:firebase-auth:9.6.0     Authentication
com.google.firebase:firebase-messaging:9.6.0    Cloud Messaging and Notifications
com.google.firebase:firebase-config:9.6.0   Remote Config
com.google.firebase:firebase-invites:9.6.0  Invites and Dynamic Links
com.google.firebase:firebase-ads:9.6.0  AdMob
com.google.android.gms:play-services-appindexing:9.6.0  App Indexing
相关问题