MP2 Assignment 3
MP2 Assignment 3
MP2 Assignment 3
Name: Score
:
Sectio Date:
n:
Objectives:
● Understand the programming fundamentals and the Python language.
● Write Python programs that utilize variables, data types, and operators.
Instructions:
1. To complete this assignment, please follow the sample commands in Python provided
to you. Once you have completed the assignment, please submit the notebook file.
2. When submitting your completed assignment, please name the notebook file as
follows: "surname_firstname_MP2AS3".
3. Header Comments
Include comprehensive header comments at the beginning of your script.
# AUTHOR INFORMATION:
1. File Naming
a. File is correctly named with surname_firstname_MP2AS3.
2. Header Comments
a. Comprehensive header comments with a clear program description, author
information, and details.
3. Comments in Code
a. Thorough comments for each section of the code, including the purpose and
functionality.
4. Functionality
a. Code executes correctly and produces accurate results.
5. Correct Output
Arithmetic: You can easily perform array with array arithmetic, or scalar
with array arithmetic.
Out[1]
Out[2]
Out[3]
Out[4]
In [5] # This will raise a Warning on division by zero, but not an error!
# It just fills the spot with nan
arr/arr
Out[5]
Out[6]
In [7] arr**3
Out[7]
Out[8]
Out[9]
Out[10]
Out[11]
Summary Statistics on Arrays: NumPy also offers common statistics like sum,
mean, and max.
Out[12]
In [13] arr.sum()
Out[13]
In [14] arr.mean()
Out[14]
In [15] arr.max()
Out[15]
Out[16]
In [17] arr_2d.sum(axis=0)
Out[17]
In [18] arr_2d.shape
Out[18]