numpy模块
在3.5公里的路段每隔0.7公里设置一路桩,创建路桩的位置数组。
import numpy as np
arr3=np.linspace(0,3.5,0.7)
print(arr3)
TypeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_58568\2770250342.py in <module>
----> 1 arr3=np.linspace(0,3.5,0.7)
2 print(arr3)
<__array_function__ internals> in linspace(*args, **kwargs)
D:\Anoconda3\lib\site-packages\numpy\core\function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis)
118
119 """
--> 120 num = operator.index(num)
121 if num < 0:
122 raise ValueError("Number of samples, %s, must be non-negative." % num)
TypeError: 'float' object cannot be interpreted as an integer