|
发表于 2020-6-9 14:33:37
|
显示全部楼层
本帖最后由 听风夜雨 于 2020-6-9 14:35 编辑 import numpy as np
with open(文件名字) as f:
for each in f:
a,b=each[:-2].split(' ')
list1=np.linspace(int(b),int(a),21)
for i in range(len(list1)-1):
print([list1[i],list1[i+1]])
print('\n\n\n')
结果[1080.0, 1171.15]
[1171.15, 1262.3]
[1262.3, 1353.45]
[1353.45, 1444.6]
[1444.6, 1535.75]
[1535.75, 1626.9]
[1626.9, 1718.0500000000002]
[1718.0500000000002, 1809.2]
[1809.2, 1900.35]
[1900.35, 1991.5]
[1991.5, 2082.65]
[2082.65, 2173.8]
[2173.8, 2264.95]
[2264.95, 2356.1000000000004]
[2356.1000000000004, 2447.25]
[2447.25, 2538.4]
[2538.4, 2629.55]
[2629.55, 2720.7]
[2720.7, 2811.8500000000004]
[2811.8500000000004, 2903.0]
[654.0, 778.4]
[778.4, 902.8]
[902.8, 1027.2]
[1027.2, 1151.6]
[1151.6, 1276.0]
[1276.0, 1400.4]
[1400.4, 1524.8000000000002]
[1524.8000000000002, 1649.2]
[1649.2, 1773.6000000000001]
[1773.6000000000001, 1898.0]
[1898.0, 2022.4]
[2022.4, 2146.8]
[2146.8, 2271.2]
[2271.2, 2395.6000000000004]
[2395.6000000000004, 2520.0]
[2520.0, 2644.4]
[2644.4, 2768.8]
[2768.8, 2893.2000000000003]
[2893.2000000000003, 3017.6]
[3017.6, 3142.0]
[73.0, 275.95]
[275.95, 478.9]
[478.9, 681.8499999999999]
[681.8499999999999, 884.8]
[884.8, 1087.75]
[1087.75, 1290.6999999999998]
[1290.6999999999998, 1493.6499999999999]
[1493.6499999999999, 1696.6]
[1696.6, 1899.55]
[1899.55, 2102.5]
[2102.5, 2305.45]
[2305.45, 2508.3999999999996]
[2508.3999999999996, 2711.35]
[2711.35, 2914.2999999999997]
[2914.2999999999997, 3117.25]
[3117.25, 3320.2]
[3320.2, 3523.1499999999996]
[3523.1499999999996, 3726.1]
[3726.1, 3929.0499999999997]
[3929.0499999999997, 4132.0]
|
|