Modules in Python:

Modules are files in Python for Data Science which contains definitions and statements. A module defines functions, classes, and variables. A module also includes runnable codes. When a module contains grouping related code, it makes the code easier to use and understand.

python data science

Import Statement:

All Python source files can be there as a module by executing an import statement in another Python source file.

In case an interpreter encounters an import statement, the module is imported if it is present in the search path. Search path is just a list of directories that is searched by the interpreter in order to import a module.

from import statement:

The from statement enables us to import specific attributes from a module.

python data science

dir() function:

The built-in function dir() returns a sorted list of strings that contain the names defined in the module. The list contains the name of all the modules, functions, and variables which are defined in a module.

Illustrating Python Built-in Modules:

If you want to learn more about modules in python for data science then you can check this and this as well. These articles will help you in understanding the industrial aspect of data science and how to proceed with this field.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.