Q:

Write a Python program to find the maximum and minimum value of a given flattened array

0

Write a Python program to find the maximum and minimum value of a given flattened array.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
a = np.arange(4).reshape((2,2))
print("Original flattened array:")
print(a)
print("Maximum value of the above flattened array:")
print(np.amax(a))
print("Minimum value of the above flattened array:")
print(np.amin(a))

Sample Output:

Original flattened array:
[[0 1]
 [2 3]]
Maximum value of the above flattened array:
3
Minimum value of the above flattened array:
0

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now