This question has been asked before here. However, the solution does not seem to work with the current version of Scipy any more.
To review, I would like to know what parameters some arbitrary Scipy distribution would require before instantiating it. The existing solution (that does not seem to work anymore, or for me at least) is as follows:
import inspect
import scipy.stat as st
def get_params(scipy_dist):
return [param for param in inspect.signature(scipy_dist._pdf).parameters if param != 'x']
Unfortunately, if one calls this on say st.norm
or st.expon
then it returns ['kwds']
.
Is there an alternative way of obtaining the parameters?