3

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.

0

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

Comments

1

If you are on Python3 it is better to invoke the help prompt first.

Python3> help ()

Then while in help prompt, type the method you are looking for

help> modulename.methodname ( if you know the modules and methods already ).

If you do not - then while in help prompt,

help> modules ( list all the modules ).

To see what methods nltk has go out of help and type

Python3> import nltk Python3> dir (nltk)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.