Introduction to Python Numpy
NumPy:
Numerical Python (NumPy) is a python library used for working with arrays.
Numpy was created by Travis Oliphant in 2005. It is an open source and can be used freely.
Which language NumPy is written in?
NumPy is a python library, it is written partially in python and most of the parts that require fast computation are written in C or C++.
Installation of NumPy:
If you have python and pip installed in your system, then installation of NumPy gets easier.
Install it using this command:
C:\\Users\Your-name>pip install numpy
If this command fails, then use a python distribution that already has numpy installed like Anaconda, Spyder etc.
Importing Numpy:
Once numpy is installed; importing it to your application gets even easier by using the keyword “import”.
Now numpy is imported and ready to use.
Alias:
Numpy is usually imported under the np alias.
“alias: Alternate name used to refer a same this”
In python, alias is created using the keyword “as”.
Now the numpy package can be referred to as np instead of numpy.
Version:
To check the version of numpy;
The version string is stored under __version__ attribute.
Why NumPy?
- Memory usage:
2. Faster:
3. Easy and simple (convenient):
With this we have come to the end of this article. Be ready to get your hands dirty.
Happy coding…..😊😊😊