Sunday, May 3, 2020

If we want to use array then we must use import NUMPY as NP it true or false??

There is no compulsory that we have to import NUMPY as NP in order to use arrays in Python. You can use any name to import the NUMPY package in Python. Below I attached the example that I have done on My computer. Here, I have imported NUMPY as NUM. You can use any name that you like to import NUMPY library. But that name you have to continue for further operations.
NumPy Example

Numpy, Scipy, and matplotlib installation through command

NumPy, SciPy and matplotlib, these three are the packages of the python. Each package has its own benefits to deal with certain data and to do different operations. Follow the instructions below to install these packages 👇👇.

-- First, we have to find the path of the installed directory of the Python tool. The path will be like C:\Users\Accountname\AppData\Local\Programs\Python\Python38-32\Scripts.  
-- After finding the path create notepad in Scripts folder with name local and write cmd in that notepad and change the extension of the file from .txt to .bat. Now, the file name is like "local.bat". 
-- Now, Open this local.bat file. You can see the command window. 
-- To install NumPy, type pip install numpy in command window and press enter button. NumPy package will download and install automatically. 
-- To install SciPy, type pip install scipy in command window and press enter button. SciPy package will download and install automatically.
-- To install matplotlib, type pip install matplotlib in command window and press enter button. NumPy package will download and install automatically.

After the installation of these packages, we can check using the following commands in IDLE(Python).
--- import numpy as np
--- import scipy as sp
--- import matplotlib.pyplot as plt

The installation procedure is successful only when you are not getting any error while running these.


And all the best...👍


no module named 'sklearn' problem while running python code.

This error occurs when there is no 'sklearn' installed package in your system. This problem can be solved by installing this package through the windows command tool. Follow the below instructions to install this package 👇👇--

-- First, we have to find the path of the installed directory of the Python tool. The path will be like C:\Users\Accountname\AppData\Local\Programs\Python\Python38-32\Scripts.  
-- After finding the path create notepad in Scripts folder with name local and write cmd in that notepad and change the extension of the file from .txt to .bat. Now, the file name is like "local.bat". 
-- Now, Open this local.bat file. You can see the command window. 
-- Type pip install sklearn. sklearn package will download and install automatically. 

Now, you can check in IDLE (Python) to confirm this package installed in your system using the following command.

-- from sklearn import datasets.

 This installation is successful only when there is no error while running this command.


 All the best... 👍