﻿ NumPy: Set the precision value to 6 and print the array of scientific notation numbers - w3resource # NumPy: Set the precision value to 6 and print the array of scientific notation numbers

## NumPy: Array Object Exercise-199 with Solution

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

Sample Solution:

Python Code:

``````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  ]
```

Python Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

What is the difficulty level of this exercise?

Test your Python skills with w3resource's quiz

﻿

## Python: Tips of the Day

List comprehension:

```>>> m = [x ** 2 for x in range(5)]
>>> m
[0, 1, 4, 9, 16]
```