2
訪問冷凍配送的名稱
當創建從scipy.stats
包frozen distribution,如何分配的名稱來訪問一次分配的實例被凍結?嘗試訪問.name
屬性會產生錯誤,因爲它不再是rv
變量的屬性。如何從spicy.stats獲取分配名稱。凍結分銷?
import scipy.stats as stats
# Get the name of the distribution
print 'gamma :', stats.norm.name
# Create frozen distribution
rv = stats.norm()
# Get the name of the frozen distribution
print 'rv :', rv.name
gamma : norm
rv :
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
9
10 # Get the name of the frozen distribution
---> 11 print 'rv :', rv.name
AttributeError: 'rv_frozen' object has no attribute 'name'