Question: python-spyder coding needed Open NumpyExercises.py and implement the following functions. Initializer() - 5 pts Create the following array in at most 3 lines of code

python-spyder coding needed
python-spyder coding needed Open NumpyExercises.py and implement the following functions. Initializer() -
5 pts Create the following array in at most 3 lines of

Open NumpyExercises.py and implement the following functions. Initializer() - 5 pts Create the following array in at most 3 lines of code and return it on the 4th line. [[1,1,1,1) [1,1,1,1) [1,1,1,2) [1.6, 1,1]] larger_diagonals(A,B) - 5 pts Given two numpy ndarrays A and B: return A if the average of A's diagonal entries is higher than the average of B's diagonal entries return B otherwise add_columns(A) - 5 pts Given an NxM array called A (M is even and M 2 2): Use array slicing to get a new array composed of only A's even columns Use array slicing to get a new array composed of only A's odd columns Element-wise add the two arrays and return the result rank_calculator(A) - 5 pts Given a numpy ndarray A, return its rank array. Input: [[ 9 4 15 0 18] [16 19 8 10 11 Return value: [[4 2 6 0 8] [79 35 1]] Return value should be an ndarray of the same size and shape as the original array A. create_checkerboard(n) - 5 pts Given N, create an NxN array with a checkerboard pattern of zeros and ones. Use slicing. Example for N = 6: [[O 101011 [101010] [0 10101) [101010] [0 10101] [101010]] import numpy as np def initializer(): return -1 def larger_diagonals(A, B): return -1 def add_columns(A): return -1 def rank_calculator(A): A return -1 def create_checkerboard (n): return -1 def main(): You can test your functions using the function calls below. Uncomment to use them. When submitting, make sure you submit a version that does not contain syntax errors. a = np.array([(4,5,10), (6,7,2]]) b = np.array([[8.4, 3.2, 6.51, 19.1, 7.4, 6.1]]) print(a) print(b)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!