Skip to main content

Introduction to Numpy

In this post I am going to introduce Numpy.Only introductory information will be included in post further.Details regarding the installation and syntax is not included within this article.



Hello All,

Today we are going to take a look at what Numpy is and the post further will introduce Numpy in more detail.

Moving on lets see what numpy is really.

On searching Numpy on Google.com I get the following result:



First link is of NumPy.org and lets see what inside.

Next on the website the description is given as follows:

NumPy is the fundamental package for scientific computing with Python. It contains among other things:

  • a powerful N-dimensional array object
  • sophisticated (broadcasting) functions
  • tools for integrating C/C++ and Fortran code
  • useful linear algebra, Fourier transform, and random number capabilities[1]

Given the popularity of NumPy(one of the reason for writing this post), its extensive use in the Artificial Intelligence field specifically the Machine Learning and Deep Learning fields.

Both Machine Learning and Deep Learning have played an important role in increasing the popularity of NumPy with the help of the results they are able to produce for the real world problems and challenges.

Numpy efficiently abstracts all the complex matrix, array and n dimensional array computation and operations behind simple function calls.

For instance if we want to increment all the values inside an array which contains only number then it can be done within one line.The following code snippet exemplifies the ease of operation(code was executed using Jupyter Notebook installed using Anaconda):

From the code snippet above we can see that arr_1 has all the values as integers and only one line of code was used to increment all the values.There is no need to iterate through all the array elements in a loop to just increment them.We can just use the "+= integer_value" way to increment every value inside the array.

There are many more benefits of using NumPy when working with N dimensional arrays which will be explored further in other posts.

Using NumPy is much simpler then we can imagine!!

Thank you.

That's all for this post!!

Thank you for reading this post.
If you have any suggestions regarding the post contents or if you need some more details on any other topic, please post it in the comments section.
Your suggestions are too valuable so they should not be missed.


References:
1.http://www.numpy.org/

Comments

Popular posts from this blog

PyMuPDF vs PDFMiner

 As a developer , I was tasked to extract specific data from a PDF. Upon analysing it further, certain patterns were found based on keywords in the document. Since I was using Python language for the task I found 2 tools quite useful which are PyMuPDF and PDFMiner. These tools can then be used to extract the text from a page on which regular expression can be applied to further extract relevant data.     Next, we are going to take a deeper look into these tools, specifically focusing on the pros and cons of each.     PyMuPDF   Docs , PIP package Pros Simple and understandable API Extensive tools to work with text, images, and graphics Available as a PIP package (pip install PyMuPDF) Better support for a range of symbols comparer to PyPDF2   Cons Parsed text is not in sequence Dependency on other package-Fitz Text sequence information lost during extraction     PDFMiner   Docs ,  PIP package ...

Finding difference between 2 files in Python

In this post, we will take a look at how to compare two files using Python.   I was tasked to compare 2 files and then list the differences between them using Python. Initially, I started with filecmp module, but even with the function parameter ‘ shallow’ set to false, the Boolean result was not enough. Sure, it can act as an indicator to take some action, but it will not list the differences.   I was looking for something more visual, something like color coding and not like the git diff output, which is not very user-friendly. But, another Python internal module, difflib helped me to get the job done.   Inside Difflib, HtmlDiff is what I was looking for. The differences were highlighted with 3 different colors and also the line numbers were indicated in a table to locate the differences. The results are quite self-explanatory and it is easier to explain the differences to other people. Code for generating the above difference table: Note: File1...

Adding existing Anaconda environment to Jupyter notebook

In this post we are going to take a look at adding Anaconda environment to Jupyter notebook. Recently, I was working on a CSV file and wanted to work with Pandas package for tabular data manipulation using Python. The problem was even if I install Pandas package, I would have to install other Data Science package as needed. But, the Anaconda environment was already setup on my laptop, which I want to reuse.   Today, we will look into how to reuse the Anaconda environment within the Jupyter Notebook.   There are 4 basic steps to be followed for adding the environment: 1. Create a conda environment Go to Conda command prompt(Run in Admin mode) Run the following command: conda create –-name newenv O/P:   What if there is an existing conda environment? Go to Conda command prompt(No need for Admin mode) Run the following command: conda env list O/P: Since there was only one environment, only one entry was displayed. ‘*’ indicates the cur...