Write a NumPy program to create an array using scientific notation numbers. Set the precision value to 6 and print the array.
import numpy as np nums = np.array([1.2e-7, 1.5e-6, 1.7e-5]) print("Original arrays:") print(nums) print("Set the precision value to 10:") np.set_printoptions(suppress=True, precision=10) print(nums)
Sample Output:
Original arrays: [1.2e-07 1.5e-06 1.7e-05] Set the precision value to 10: [0.00000012 0.0000015 0.000017 ]
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