An important ability of a data scientist/data engineer is to know where and how to find information that helps you to accomplish your work. In the exercise, you will both practice the Numpy features we discussed in the lesson and learn new features by looking up documentations and references. You will work on your own but remember the teaching staff is at your service whenever you encounter problems.
Open the main.py
file in the your-code
directory with your favorite text editor. There are a bunch of commentations starting with #
which instruct what you are supposed to do step by step. Follow the order of the instructions from top to bottom. Read each instruction carefully and provide your answer beneath it. You should also test your answers in Python in the terminal to make sure your responses are correct. If one of your responses is incorrect, you may not be able to proceed because later responses may depend upon previous responses.
For instance, in the first few lines of main.py
, you see:
#1. Import the NUMPY package under the name np.
#2. Print the NUMPY version and the configuration.
You will write the codes as instructed:
#1. Import the NUMPY package under the name np.
import numpy as np
#2. Print the NUMPY version and the configuration.
print(np.version.version)
"""
1.15.2
"""
💡 The #
sign in Python allows you to make single-line commentation. The """
(triple quotes) allows you to make multi-line commentation. Remember you always need a pair of triple quotes and you insert your commentations in between.
Continue answering each question until you reach the end of main.py
.
main.py
with your responses to each of the instructions.
Upon completion, add your version of main.py
to git. Then commit git and push your branch to the remote.
Some of the questions in the assignment are not covered in our lesson. You will learn how to efficiently look up the information on your own. Below are some resources you can find the information you need.
If you are way ahead of your classmates and willing to accept some tough challenges about Numpy, take one or several of the following Codewar katas. You need to already possess a good amount of knowledge in Python and statistics because you will need to write Python functions, do loops, write conditionals, and deal with matrices. Add your responses to the katas to your-code
and submit to the instructor.