Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2 Write a program to select out the elements from the above array A, only if its value is greater than 5 . Expected
Problem 2 Write a program to select out the elements from the above array A, only if its value is greater than 5 . Expected output: array([12, 8, 9, 17, 7, 11, 19, 21]) Problem 3 If the value of the elements in Array A is greater than 5, write a program to replace that element with zero. Expected output: array([[1,4,5,0,5],[5,0,0,0,0],[6,0,0,0,0]) Problem 4 Write a program to vertically stack the following two 1-dimensional arrays and insert a new array at the end row. The elements of the new array must be the sum of the x and y arrays down the column. x=np.array([1,2,3])y=np.array([4,5,6]) Expected output: array([[1, 2, 3], [4,5,6], [5,7,9]1) Problem 5 Write a program to vertically stack the following two 1-dimensional arrays and insert a new array at the end column. The elements of the new array must be the sum of the x and y arrays across the row. x=np.array([1,2,3])y=np.array([4,5,6]) Expected output: array([[ 1, 2, 3, 6], [4,5,6,15]])
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started