Library Import Made Easy: Pyforest (PYTHON)
Python is a coding language that is used worldwide to perform various tasks such as Maths, Calculus, Graphs etc we require various libraries such as NumPy, pandas, math, matplotlib,scipy,sklearn etc these libraries are to be preinstalled by using pip installer or conda installer depending on the compiler we are using for python code compilation.
Library Import Made Easy: Pyforest (PYTHON)
Python is a coding language that is used worldwide to perform various tasks such as Maths, Calculus, Graphs etc we require various libraries such as NumPy, pandas, math, matplotlib,scipy,sklearn etc these libraries are to be preinstalled by using pip installer or conda installer depending on the compiler we are using for python code compilation. For different functions, we need to import the libraries based on the following code:
- Import NumPy as np
- Import matplotlib.pyplot as plt
- Import pandas as pd
- Import sklearn as sk
The list continues as the number of libraries we need to use in python, in particular, for data science more libraries are to be imported so as to do the particular operation to ease out all the modules can be imported by a single command Import pyforest as py which consist of many commonly used libraries such as NumPy, pandas etc..
How to Install py forest:
Using pip installer: Go to Command Prompt and type python -m pip install pyforest
Using Conda /anaconda installer: conda install pyforest
Using /jupyter notebook etc: pip install pyforest
How to get the Variable to which libraries are stored:
The standard way of definitions is used in the same way it is imported. As per the manual method we use variables like plt, np,pd, sk etc in these same variable names that are imported. Still, if you need to check the variable names you can use a simple command as shown below.
Note: Here we use sublime Text to view the use of pyforest

- From the above code, we have imported the pyforest using the command import pyforest
- Created arrays a and b as shown
- Used NumPy which is saved in np to create the linspace
- Used matplotlib.pyplot stored as plt to plot variables a and b
- To check which libraries are used
- print(lazy_imports())# The variables to which each libraries are imported which are inactive
- print(active_imports()) #The libraries which are currently Active or used

The inactive libraries with the variable to which they are imported are being displayed using the lazy_imports() command. Similarly, the ones which are used are also showare also shown using the command active_imports()
