![](/img/trans.png)
[英]Why do I get AttributeError: 'numpy.ndarray' object has no attribute 'replace' in python?
[英]How do I solve numpy.ndarray' object has no attribute 'histogram' on python
我想隨機 select 數字與概率根據 2 個正態/高斯分布的總和並制作直方圖。
基本上
import numpy as np
u, vth = 0,1 # mean and standard deviation
v= np.random.normal(u, vth, 1000)+np.random.normal(-u, vth, 1000)
v.histogram()
但是我收到錯誤 numpy.ndarray' object has no attribute 'histogram'。 另一個問題是這沒有標准化,所以我的結果不應該是正確的......
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.