Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python help command

Tags:

python

How can Python's help information on a given module/function be obtained?

For example, to obtain information on scipy's chi2, the following commands:

>> from scipy.stats import chi2
>> help(chi2.pdf)

provide only general help:

Help on method pdf in module scipy.stats.distributions:

pdf(self, x, *args, **kwds) method of scipy.stats.distributions.chi2_gen instance

Probability density function at x of the given RV.

etc.

How can the specific details be obtained? In this example something like:

The function call is chi2.pdf(x, v) with v degrees of freedom.

like image 825
aslan Avatar asked Nov 27 '25 18:11

aslan


1 Answers

The help() function only displays the docstring of the object you're calling it on. If that object doesn't have one (or one that doesn't contain the information you're after), you will need to look at the documentation of the module/function/object you're using.

like image 87
Tim Pietzcker Avatar answered Nov 30 '25 07:11

Tim Pietzcker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!