Question: Python please, will thumbs up! 1. Put the list of numbers [1,,12] into all possible shapes of 2-dimensional, and 3-dimensional numpy arrays, using the reshape

Python please, will thumbs up!

Python please, will thumbs up! 1. Put the list of numbers [1,,12]

1. Put the list of numbers [1,,12] into all possible shapes of 2-dimensional, and 3-dimensional numpy arrays, using the reshape command. Print the results. Only try the shapes where all dimensions are greater than one (i.e., don't make a 1 by 12 array). 2. Make a square array containing the numbers [0,,99]. Use list-slicing syntax to reverse the row-order of this array. Use list-slicing syntax to transpose this array (reflect it across the diagonal of the original). 3. If you roll ten fair 6-sided dice, you expect the total to be 35 , on average. The minimum total would be 10 and the maximum would be 60 . Use numpy to create a array with 50 rows and 10 columns of random dice rolls (random integers between 1 and 6 ). By summing rows, create an array of numbers between 10 and 60 . What is the average of this array (a number between 10 and 60)? What is the standard deviation of this array? (Use the np.std function for standard deviation.) Use numpy functions throughout -- no loops please! 4. Define a function matrix_pow (M,e) which takes as input a square matrix M and a natural number e. The output should be the result of matrix multiplication, with M multiplied by itself e times. When e is zero, the function should output the identity matrix np.eye(s) where s is the number of rows (or columns) of M. 5. The matrix exponential is defined by the same Taylor series as the usual exponential function, but one allows square matrices as inputs instead of just numbers. Define a function matrix_exp(M) which computes the matrix exponential of M using the first 20 terms of the (familiar) series, and uses the matrix_pow function from the previous

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!