Q:

Write a NumPy program to create an array using scientific notation numbers. Set the precision value to 6 and print the array

0

Write a NumPy program to create an array using scientific notation numbers. Set the precision value to 6 and print the array.

All Answers

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

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  ]

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