Creating a NumPy Array - Question 4

Last Updated :
Discuss
Comments

What will be the output of the following code?

Python
import numpy as np
arr = np.array([1, 2, 3, 4])
arr = arr.astype(float)
print(arr)


[1 2 3 4]

[1.0 2.0 3.0 4.0]

[1. 2. 3. 4. ]

Error

Tags:
Share your thoughts in the comments