Numpy in practice

Subham Singh
3 min readDec 22, 2019

Wikipedia writes about Numpy as NumPy (pronounced /ˈnʌmpaɪ/ (NUM-py) or sometimes /ˈnʌmpi/ (NUM-pee)) is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.

This is the first part of Numpy in Practice series.

We are going to practice some good questions on numpy in this and another subsequent 8 or 9 blogs, I have practised these exercises when I first started studying numpy, so stay tuned. We will start with importing numpy.

  1. Importing numpy as alias np

2. Creating a null Vector.

3. Getting documentation of numpy add function.

4. Creating a null vector of size 5 while the second value is non-zero.

5. Creating a vector with values ranging from 1 to 10.

6. Reversing a Vector.

7. Finding Memory size of an Array.

8. Creating a 3x3 matrix with values ranging between 0–8.

9. Finding indices of non-zero elements from a list.

10. Creating a 3x3 or as required Identity Matrix.

I have used Jupyter notebook to run all these codes. You can use on whichever application you are familiar or comfortable with. If any doubt you can ask in comment section below.

Click here for the next practice questions on Numpy.

--

--

Subham Singh

Data Science, Machine Learning and Deep Learning practitioner. Always ready to learn and lead. Linkedin username “subham121singh”