range :只能是整数间隔 arrange:可以根据函数设定规定间隔大小 例:
import numpy as np text01 = list(range(2,5,2)) text02 = list(np.arange(0,5,0.2)) print(text01) print(text02)
结果:
[2, 4] [0.0, 0.000001, 0.000002, 0.000009,