NumPy : For the absolute beginner



This post is for those that want an overview of NumPy, for those that want a more detailed view check out our intermediate level post, and for an in-depth guide for NumPy check out our post "NumPy: An In-depth Look"


WHY LEARN NUMPY, & WHO USES IT?

From enthusiasts of code and science, amateurs of python, and beginner learners of code to researchers handling state-of-the-art scientific R&D, and advanced development, all are in common users of NumPy.

Why u ask, well it is easy to use, easy to learn, and a great object-oriented alternative to python list which is very slow. NumPy provides an alternative to a traditional python list in the form of ndarray which is 50x (or 50 times) faster.
 As NumPy has vectorization the vectorized code that has fewer lines of code also has fewer bugs.
NumPy is also used in machine learning and used simultaneously with Pandas & Matplotlib.

All in all a great asset to any enthusiast of coding, any budding, aspiring, or experienced data scientist.

HOW TO INSTALL NUMPY?

To get NumPy with pip installer, use the code:

pip install numpy

or if you have anaconda(if you don't know about this don't worry, we shall discuss this software later) installed the following will also suffice

conda install numpy


WHAT IS NUMPY?

NumPy stands for Numerical Python.

It is an open-source, BSD licensed Python library created in 2005 which is used everywhere in the field of computer science, engineering, data science, machine learning, etc., thus very important for you to learn.


WHERE & WHEN WOULD YOU USE NUMPY?

NumPy is a package that provides a multi-dimensional array object which comes into use when there are requirements for a multi-dimensional array, in cases of discrete Fourier Transform, linear algebra, random distribution, fast arrays, and matrices to name a few.

HOW TO IMPORT AND USE NUMPY?

To use NumPy we use the import, the following code provides access to NumPy and its functions

import numpy as np
importing NumPy as np results in the abbreviation of "numpy" and it's easier to write code, and also it's an industry standard to do so.

Following are the fundamentals of NumPy that are to be learned to name a few.

1. Creation of Array
2. Indexing & Slicing 
3. Iterating 
4. Conversions & ndarray
5. Data Types 
6. Indexing on ndarray
7. Manipulation of Shape
8. Copy & View
9. Ordering
10. Statistics & Linear algebra

NumPy array is not the same as traditional arrays in python (array.array). Traditional arrays are one-dimensional but not ndarray.

Following are some of its functions(not all of them)

1. ndarray.ndim
2. ndarray.size
3. ndarray.dtype
4. ndarray.shape
5. ndarray.data
6. ndarray.itemsize
7. np.arange
8. np.ones
9. np.random

Why do you think I have written these functions above?

It is to sensitize the reader (you) with these functions and perhaps remove the apprehensiveness you might have had with these functions and fundamentals.

WHICH LANGUAGE IS IT IN?

It is written using C, C++ & Python, only the parts that have computation have their encoding done in C & C++ to provide a fast, responsive, and light-weight result-oriented computing feels to it.

WHAT IS NUMPY'S ORIGINAL WEBSITE AND WHERE IS ITS CODEBASE?

NumPy's original website is https://numpy.org/ and its codebase can be found on GitHub, to check, click the following link, https://github.com/numpy/numpy

That is all folks !!!

Post a Comment

Previous Post Next Post