Question: Write a Python program that accomplishes the following: 1 . Generate a random 2 - dimensional NumPy array of size ( m , n )

Write a Python program that accomplishes the following:
1. Generate a random 2-dimensional NumPy array of size (m,n) with random integers ranging from 0 to 99.
2. Reshape the array to size (m*n,1) using the reshape() function.
3. Compute the mean, median, and standard deviation of the array using NumPy functions.
4. Slice the array to get the first k elements, where k is the total number of elements in the array divided by 2.
5. Split the array in to p equal parts, where p is a random integer between 2 and 5.
6. Compute the element-wise sum of the split arrays using vectorisation.
Your program should output the original random array, the reshaped array, the mean, median, and standard deviation of the array, the sliced array, the split arrays, and the element-wise sum of the split arrays.

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 Programming Questions!