'Python: How to print an ndarray in scientific notation (rounded) as part of a print statement
I have an ndarray that I want to print in scientific notation with rounding as part of a sentence, this is what I currently have
data_arr = np.array([12345, 12345])
print('This is the data ', *data_arr)
and the output is
This is the data 12345 12345
Is there a way to print in scientific notation, with rounding, preferably in one line, like below?
This is the data 1.2e+04 1.2e+04
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
