NumPy (Numerical Python)
NumPy is an open source Python library used for Scientific Computation , it is used in every field of science & engineering.
(All the information given is stated by assuming that user is working on Google Colab on which NumPy comes pre-installed).
NumPy is a multi-dimensional array library , we can use it to store all sorts of data in 1-D,2-D,3-D,4-D arrays etc. Then one question which comes in our mind is , Why to use NumPy when we can use lists?
This is because , NumPy is very much faster than the lists & we can also perform more operations using NumPy than lists.
Features
- Open Source.
- Intuitive: makes coding easy & concepts are easy to understand & implement.
- Community: a large number of people are using it , hence a lot of open source contribution.
etc.
Applications
- Backend(Pandas, Digital Photography)
- Machine Learning
- Plotting(matplotlib)
and many more…
Importing NumPy
Input - import numpy as np
Yes, that’s it , as simple as that.
We import it as ‘np’ to save time & to avoid writing the whole name again & again.
Once we import it , we’re good to go to perform various operations.
Miscellaneous
We can also Use Numpy to convert our image into array.
Let’s take an example-
This can also be done using Matplotlib & this concept is widely used in Image Classification Problems.
Happy Learning folks!
Follow me on LinkedIn- https://www.linkedin.com/in/imvat18/