2- Generate a (5, 5) numpy array that consists of random values between 20 and 40 and answer the following: (Check this function np.random.random_integers ) a. What is the minimum value in each row b. What is the mean for each column c. Count the number of elements in the array whose values are greater than 30 d. Display the elements in the arrays that are less than 30 e. Add 5 to elements whose value is less than 30. f. Display the top 10 elements in the array

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 29SA
icon
Related questions
Question

PYTHON 

2- Generate a (5, 5) numpy array that consists of random values between 20 and 40 and
answer the following: (Check this function np.random.random_integers )
a. What is the minimum value in each row
b. What is the mean for each column
c. Count the number of elements in the array whose values are greater than 30
d. Display the elements in the arrays that are less than 30
e. Add 5 to elements whose value is less than 30.
f. Display the top 10 elements in the array
Transcribed Image Text:2- Generate a (5, 5) numpy array that consists of random values between 20 and 40 and answer the following: (Check this function np.random.random_integers ) a. What is the minimum value in each row b. What is the mean for each column c. Count the number of elements in the array whose values are greater than 30 d. Display the elements in the arrays that are less than 30 e. Add 5 to elements whose value is less than 30. f. Display the top 10 elements in the array
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning