Write a Python program to find the maximum and minimum value of a given flattened array. Expected Output: Original flattened array: [[0 1] [2 3]] Maximum value of the above flattened array: 3 Minimum value of the above flattened array: 0
import numpy as np
data=np.array([[0,1],[2,3]])
print(data)
print("Maximum value of the bove flattened array:",np.max(data))
print("Minimum value of the bove flattened array:",np.min(data))
"""
OUTPUT-
/Desktop/FDS/Assignment no-2/Set A$ python3 A1.py
[[0 1]
[2 3]]
Maximum value of the bove flattened array: 3
Minimum value of the bove flattened array: 0
"""
Comments
Post a Comment