我有一个数组,想要找到两个数字之间的平均值,并在两个数字之间添加一个附加元素。例如,如果我从
x = np.array([1, 3, 5, 7, 9])
我想结束
[1, 2, 3, 4, 5, 6, 7, 8, 9]
我该怎么做呢?
python numpy
numpy ×1
python ×1