NumPyGetting Started
Installation of NumPy
If you havePython andPIP already installed on a system, then installation of NumPy is very easy.
Install it using this command:
If this command fails, then use a python distribution that already has NumPy installed like, Anaconda, Spyder etc.
Import NumPy
Once NumPy is installed, import it in your applications by adding theimport
keyword:
Now NumPy is imported and ready to use.
NumPy as np
NumPy is usually imported under thenp
alias.
alias: In Python alias are an alternate name for referring to the same thing.
Create an alias with theas
keyword while importing:
Now the NumPy package can be referred to asnp
instead ofnumpy
.
Checking NumPy Version
The version string is stored under__version__
attribute.