In simple terms Python packages are collections of multiple Python files.
And these Python files are known as modules in Python. If we keep all of our code in the same file, it will result in:
If we take an example of ourselves, we don't usually store all of our files on our computer in the same location. We use a well-organized hierarchy of directories/folders for easier access.
Similar files are kept in the same directory, for example, we may keep all the songs in the "music" directory. Analogous to this, Python has packages for directories and modules for files.
As our application program grows larger in size with a lot of modules, we place similar modules in one package and different modules in different packages. This makes a project (program) easy to manage and conceptually clear.
Similarly, as a directory can contain subdirectories and files, a Python package can have sub-packages and modules.
Packages are Directory/Folder of Python Scripts.
Where each script is a module that performs a specific function. We can specify functions, methods, types in a script.
Thousands of packages are available in python.
For data science, the commonly used packages are:
A Python package can have sub-packages in it. Further these sub-packages have some modules (i.e. Python files).
Each module consists of some Python functions. To make use of these functions we need to load the module in our working environment.
To load any package or module we use the term import followed by module name or the package name.
In the video, tutor has loaded ‘math’ module of Python and used functions like sqrt (to calculate square root of a number), pow (to calculate power of a number), etc.