Write a NumPy program to convert an array to a float type
- برمجة بايثون
- 2021-09-11
- mhanasmh00489829403
الأجوبة
import numpy as np
import numpy as np
a = [1, 2, 3, 4]
print("Original array")
print(a)
x = np.asfarray(a)
print("Array converted to a float type:")
print(x)
Sample Output:
Original array [1, 2, 3, 4] Array converted to a float type: [ 1. 2. 3. 4.]
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
