diff --git a/q1.py b/q1.py new file mode 100644 index 0000000..054d9b2 --- /dev/null +++ b/q1.py @@ -0,0 +1,16 @@ +import numpy as np +# 1. Creat my_array and print the shape of it +my_arr = np.array([9, 8, 7, 6, 5, 4, 3, 2, 1]) +print("Shape of my_arr: " + str(my_arr.shape)) + +#2 My_mat and its shape +my_mat = np.tile(my_arr, (3, 1)) +print("Shape of my_mat " + str(my_mat.shape)) + +#3. Create my_prod and print it +my_prod = my_arr * my_arr +print("my_prod:" + str(my_prod)) + +#4. Sort my_prod and print it +my_prod_sorted = np.sort(my_prod) +print("My_prod sorted: ", my_prod_sorted)