我有一个索引长度为1440的原始数据帧,已将其与pd.transpose进行转置,现在索引长度为48。现在,当我尝试遍历行时会抛出KeyError:1440
threshold = 5
backlogged = backlogged.transpose()
backlogged = backlogged.reset_index()
print(backlogged)
for i in range(len(backlogged.loc[i, 'max'])):
if i > threshold:
backlogged.loc[i, 'redline'] = -1
我希望在此数据帧中添加一列包含真/假值的新列(红线)