Python 如何从Spicle.stats获取分发名称。冻结分发? 访问已冻结分发的名称

Python 如何从Spicle.stats获取分发名称。冻结分发? 访问已冻结分发的名称,python,random,scipy,distribution,Python,Random,Scipy,Distribution,当从包创建分发时,一旦分发实例冻结,如何访问分发的名称?尝试访问.name属性会产生错误,因为它不再是rv变量的属性 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 pri

当从包创建分发时,一旦分发实例冻结,如何访问分发的名称?尝试访问
.name
属性会产生错误,因为它不再是
rv
变量的属性

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

冻结的分发
rv\u已冻结
Class 冻结的分发,或在初始化期间创建分发的实例,该实例存储在属性中。要访问原始发行版的属性,请使用
rv.dist.{attribute}

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.dist.name

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.dist.name
gamma : norm
rv    : norm