我正在尝试根据值将数据分为几类。因此,高于 -25 的值被指定为熊级别 0,依此类推。但是当我查看数据时,我可以看到有低于 -25 的值被指定为熊级别 0。所有类别都是如此。
###############################################################
Bear_level = ['high', 'medium-high', 'medium', 'medium-low', 'low', 'very-low']
Level=[]
for value in data_shifted[k]['SCI300max [um]']:
if value >= -25:
Level.append(Bear_level[0])
elif value < -25 and value >= -50:
Level.append(Bear_level[1])
elif value < -50 and value >= -75:
Level.append(Bear_level[2])
elif value < -75 and value >= -100:
Level.append(Bear_level[3])
elif value < -100 and value >= -150:
Level.append(Bear_level[4])
else:
Level.append(Bear_level[5])
Amount = 0
for i in Bear_level:
for m in range(int(len(Level))):
if Level[m] ==i:
Amount += 1
print(Amount)
Amount = 0
for k in data_shifted:
data_shifted[k]['Bear Level']= Level
data_interp={k:[] for k in progression}
for k in data_interp:
data_interp[k]=data_shifted[k][['Chainage [m]', 'Driving Speed [m/s]', 'Latitude', 'Longitude', 'Road temperature [C]', 'Air temperature [C]','Temp corrected Bells2_50','Load Left [kg]','Load Right [kg]', 'Dmax [um]', 'D0 [um]', 'D300 [um]', 'D600 [um]', 'D900 [um]', 'D1200 [um]', 'D1500 [um]', 'SCI300max [um]','SCI300 [um]','SCI300diff [um]', 'SCI600max [um]','SCI600 [um]', 'SCI900max [um]','SCI900 [um]', 'SCI600max-SCI300max [um]', 'SCI900max-SCI600max [um]','speedfilter', 'Bear Level', 'Traffic [ESALs x day]', 'Layer1 Thickness [m]']]
data_interp[k]= data_interp[k][data_interp[k]['speedfilter']=='Pass']
我希望有人能够看到问题,因为我迷失了想法。
慕仙森
相关分类