实现代码1:
import numpy as np
sv_index = np.array(0)
line = 7.65
sv_index = np.vstack((sv_index,line))
print(sv_index)
运行结果1:
与
实现代码2:
import numpy as np
sv_index = np.array([0])
line = 7.65
sv_index = np.vstack((sv_index,line))
print(sv_index)
运行结果2:
实现代码3:
import numpy as np
sv_index = np.array(0)
line = [7.65]
sv_index = np.vstack((sv_index,line))
print(sv_index)
运行结果3:
三者结果一样,所以输入参数形式并不重要!