Learn essential Numpy functions for data science

Numpy was the only thing that made me, a die-hard C++ coder, shift to python in the first place. Mind you, this was before my data science learning curve, where no one can survive without python! (No offense, please, just stating my opinion, all the R lovers, I respect you guys all the same). But if one library can change my loyalty to a programing language, then it must be one hell of a library.

In the robotics lab that I interned at once, we used to quiz each other on weird Numpy commands, and that is when I got to see the beauty of this library truly. So if you pass the following test, by all means, you don’t need this blog :P. But otherwise, keep reading!!

Test: Predict the output of the following

import numpy as np

arr = np.arange(5)
arr = arr[-1::-1]
print(arr)

If you already know this, you probably know most of what I will cover through this blog but otherwise, keep reading.

Output is [4,3,2,1,0]

Let’s dive into functions of Numpy that make it a lifesaver for us, especially for me because I hate writing double for loops to access a 2D array.

GIPHY

Note: In all future examples, I have assumed that import numpy as np has been called

#artificial-intelligence #python #data-science #numpy #machine-learning #10 quick numpy tricks that will make life easier for a data scientist

10 Quick Numpy Tricks That Will Make Life Easier for A Data Scientist
1.25 GEEK