Write a NumPy program to suppresses the use of scientific notation for small numbers in NumPy array.
import numpy as np x=np.array([1.6e-10, 1.6, 1200, .235]) print("Original array elements:") print(x) print("Print array values with precision 3:") np.set_printoptions(suppress=True) print(x)
Sample Output:
Original array elements: [1.60e-10 1.60e+00 1.20e+03 2.35e-01] Print array values with precision 3: [ 0. 1.6 1200. 0.235]
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer