Learn practical skills, build real-world projects, and advance your career

Assignment 2 - Numpy Array Operations

This assignment is part of the course "Data Analysis with Python: Zero to Pandas". The objective of this assignment is to develop a solid understanding of Numpy array operations. In this assignment you will:

  1. Pick 5 interesting Numpy array functions by going through the documentation: https://numpy.org/doc/stable/reference/routines.html
  2. Run and modify this Jupyter notebook to illustrate their usage (some explanation and 3 examples for each function). Use your imagination to come up with interesting and unique examples.
  3. Upload this notebook to your Jovian profile using jovian.commit and make a submission here: https://jovian.ml/learn/data-analysis-with-python-zero-to-pandas/assignment/assignment-2-numpy-array-operations
  4. (Optional) Share your notebook online (on Twitter, LinkedIn, Facebook) and on the community forum thread: https://jovian.ml/forum/t/assignment-2-numpy-array-operations-share-your-work/10575 .
  5. (Optional) Check out the notebooks shared by other participants and give feedback & appreciation.

The recommended way to run this notebook is to click the "Run" button at the top of this page, and select "Run on Binder". This will run the notebook on mybinder.org, a free online service for running Jupyter notebooks.

Try to give your notebook a catchy title & subtitle e.g. "All about Numpy array operations", "5 Numpy functions you didn't know you needed", "A beginner's guide to broadcasting in Numpy", "Interesting ways to create Numpy arrays", "Trigonometic functions in Numpy", "How to use Python for Linear Algebra" etc.

NOTE: Remove this block of explanation text before submitting or sharing your notebook online - to make it more presentable.

About NumPy

NumPy is the basic kit for scientific computing in Python. It is a Python library that gives a multidimensional array object, various derived objects (such as masked arrays and matrices), and a variety of routines for fast operations on arrays.

There are numerous differences between NumPy arrays and the conventional Python sequences:

  1. NumPy arrays produce a fixed size at creation, unlike Python lists (which can expand dynamically). Varying the size of a ndarray will form a new array and delete the original one.

  2. The elements in a NumPy array hold all required to be of the identical data type, and therefore will be the equal size in memory.

  3. NumPy arrays facilitate high-level mathematical and other types of operations on large amounts of data.

The below functions which I have chosen for this assignment and I felt are helpful in Data Science.

  • function 1 = np.T
  • function 2 = np.mean()
  • function 3 = np.average()
  • function 4 = np.polyder(p, m)
  • function 5 = np.linalg.eig(a)

The recommended way to run this notebook is to click the "Run" button at the top of this page, and select "Run on Binder". This will run the notebook on mybinder.org, a free online service for running Jupyter notebooks.

!pip install jovian --upgrade -q
import jovian
jovian.commit(project='numpy-array-operations')
[jovian] Updating notebook "azizforai/numpy-array-operations" on https://jovian.ai [jovian] Committed successfully! https://jovian.ai/azizforai/numpy-array-operations

Let's begin by importing Numpy and listing out the functions covered in this notebook.