我想在Python代碼中運行IDL腳本,因爲我需要稍後在python腳本中分析IDL代碼的結果,但我不知道它是如何工作的。 我想打電話給例如該IDL腳本在Python代碼: pro plotgaussian, center, sigma, X=x, Y=y
x = findgen(1000)/999; numbers running 0 to 1 in steps of 0.001
x = x
我已經寫在IDL代碼,我要轉換爲R. 我發現這個函數的代碼中: result = linfit(dum_x, dum_y)
y_a= result[0]
y_b= result[1]
"LINFIT function" which fits the paired data { xi , yi } to the linear model, y = A + Bx,
b
我想爲scipy.stats.powerlaw例程提供一個負指數,例如, A = -1.5,以繪製隨機樣本: """
powerlaw.pdf(x, a) = a * x**(a-1)
"""
from scipy.stats import powerlaw
R = powerlaw.rvs(a, size=100)
爲什麼是a> 0時所需的,如何可以爲了生成隨機樣品提供負一,以及如