scipy.stats.norm
凍結された分布 (つまり、特定の手段/分散) のインスタンスに追加機能を持たせることができるように、サブクラス化したいと考えています。ただし、インスタンスを構築する最初のステップを通過できません。
編集:これは私の問題を示すインタラクティブなセッションのトランスクリプトです(私の袖には何もありません)
In [1]: import scipy.stats
In [2]: class A(scipy.stats.norm):
...: def __init__(self):
...: super( A, self).__init__()
...:
...:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/Dave/src/python2.7/density_estimation/<ipython console> in <module>()
/usr/lib64/python2.7/site-packages/scipy/stats/distributions.pyc in __init__(self, momtype, a, b, xa, xb, xtol, badvalue, name, longname, shapes, extradoc)
958
959 if longname is None:
--> 960 if name[0] in ['aeiouAEIOU']:
961 hstr = "An "
962 else:
TypeError: Error when calling the metaclass bases
'NoneType' object is not subscriptable
scipy.stats
何かの特定のインスタンス(sometype?)である奇妙なことをしていることがわかりnorm
ますが、それは通常のクラス定義ではないため、コンストラクターを呼び出す方法がわかりません。
編集#2:scipyのバージョンが関連している可能性があります。
In [19]: scipy.__version__
Out[19]: '0.9.0'