This is a first set of articles in the series of Python for data sciences. Previously, we discussed ‘why
python is a suitable language for learning data science’.
From this article, we start learning python for data sciences. We are going to start with NumPy library, short for Numerical Python library. NumPy is a library used for performing arithmetic operations as well as linear algebraic operations and other mathematical operations on arrays. Since the mathematics involved in computing machine learning algorithms is inherently linear algebra.
Almost all the machine learning packages like Scipy (Scientific Python), Scikit-learn and the data pre-
processing library, Pandas are all built on top of Numpy.
In this set of articles, keeping in mind the beginners in data science, we will cover the following. I
plan to divide this NumPy for beginners into 3 parts.
|PART 1:||1. What is a NumPy array?|
|2. How to create and inspect NumPy arrays?|
|PART 2:||3. Array indexing|
|4. Array manipulations and Operations|
|PART 3:||5. What is broadcasting?|
|6. Speed test: Lists Vs NumPy array|
Advantages of NumPy array over a list is its speed and the compact nature of the code. At the end, in
part 3 of NumPy series, we will do a small speed test and see how fast an arithmetic operation is
performed on NumPy over lists or for that matter, any other data structure. I preferred to keep it in
the last, so that the reader can appreciate it.
In this course, we will be using the Jupyter notebook as our editor. So let’s start!
I assume you have python installed on your laptops already. If not, check our previous article to see
how we install Anaconda. If you have Anaconda, you can simply install NumPy from your terminal or
command prompt using:
conda install numpy
If you do not have Anaconda on your computer, install NumPy from your terminal using:
pip install numpy
Once you have NumPy installed, launch your Jupyter notebook and get started.
Don’t worry; we will dive easy and simple. The articles are meticulously articulated for conceptual
understanding together with hands-on.