Education

# Quick Dive In Python’s NumPy for Data Science

Python NumPy is one of the most used libraries in the world of Data Science. Travis Oliphant created NumPy in 2005 as an open source project which means you can use it freely. Its a library that supports multi-dimensional arrays and matrices. It also has a large collection of high level scientific and mathematical functions to operate on these arrays. Python NumPy also have functions for linear algebra and fourier transforms that is used many times in data science.

## Why should we use NumPy arrays?

There are many reasons why we should use NP arrays one particularly being it uses less memory to store data. The NP arrays takes less amount of memory as compared to its python brother lists. Another reason why we should use NP instead of lists is Its really helpful when it comes to creating n-dimensional arrays which allows you to create matrix and tensors in no time. To know more why you shoud you use NP I suggest you read Deepak K Gupta blog on A hitchhiker guide to python NP Arrays.

The source code of its library is available Here if you want to know more.

### Now we have a little introduction into the subject, lets begin our little dive.

#### Import NumPy and use NP arrays:

So we have created 2 np arrays using these methods:

You can also pass a multi-dimensional array to create a np array:

### Operations in NumPy:

We can do various operations with NP arrays such as addition, subtraction, multiplication, division and power as shown below:

This would be enough to give you an idea of what are NP arrays and how to deal with them and use operations.