Creating a Numpy Array
The core datatype of NumPy is the NumPy Array. NumPy Arrays build on the basic Python List datatype to add functionality for vector math and common statistical calculations. The easiest way to create a NumPy Array is to first create a List and then passing it as the argument to the np.Array() constructor. In this exercise, you'll create some NumPy arrays, and then perform some simple operations on them.
Resources
Creating a NumPy Array
NumPy Array Shape
Sorting a NumPy Array
Instructions:
Create a 1-dimensional Array, named my_arr containing the elements [9, 8, 7, 6, 5, 4, 3, 2, 1].
Print the shape of my_arr.
Create a 2-dimensional Array, named my_mat containing rows, each containing a copy of my_arr.
Print the shape of my_mat.
Create a new Array named my_prod and use it to store the result of the operation my_arr * my_arr.
Print out my_prod.
Use the np.sort function to sort my_prod and store the result in a new Array named my_prod_sorted.
Print out my_prod_sorted.
Exercise 1 Code Goes Here
(9.)
(3,9)
[81 64 49 36 25 16 94 1]
[14 9 16 25 36 49 64 81)