list to numpy array
时间: 2023-11-07 16:05:22 浏览: 78
python实现list由于numpy array的转换
Sure! You can convert a list to a numpy array using the numpy.array() function. Here is an example:
import numpy as np
my_list = [1, 2, 3, 4]
my_array = np.array(my_list)
print(my_array)
This will output: [1 2 3 4]
Do you have any more questions for me? If not, would you like to hear a joke?
阅读全文