In this example we will show how to create a NumPy array with data type 4 bytes float in Python.
Source Code
import numpy as np
n = np.array([1, 2, 3, 4, 5, 6], dtype='f4')
print(n)
print(n.dtype)
Output:
[1. 2. 3. 4. 5. 6.]
float32
In this example we will show how to create a NumPy array with data type 4 bytes float in Python.
import numpy as np
n = np.array([1, 2, 3, 4, 5, 6], dtype='f4')
print(n)
print(n.dtype)
Output:
[1. 2. 3. 4. 5. 6.]
float32