0

For example I remember that I need train_test_split function from sklearn module, but I don't remember I need to use from sklearn.model_selection import train_test_split for import, I've tried to use help() in interactive mode with no results for train_test_split string:

import sklearn
help() # then type 'train_test_split' in interactive mode

do I need load each submodule and search pattern there ?

1
  • I use PyCharm which suggests matches. Commented May 25, 2022 at 18:28

1 Answer 1

1

Maybe you can Google train_test_split until unless you are asking generally How to search a function in a module: Maybe this Question

In that case you can use

dir(sklearn)
help(sklearn)

from inspect import getmembers, isfunction, isclass
    
getmembers(sklearn, isfunction)
Sign up to request clarification or add additional context in comments.

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.