Write a NumPy program to create an array using scientific notation numbers. Set the precision value to 6 and print the array
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
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 ]
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال