0
import xlrd
file_path = r"C:\Users\Allen\Desktop\数据曲线.xlsx"
table = xlrd.open_workbook(file_path).sheet_by_index(2)
data_current = table.col_values(4)[1:]
data_time = table.col_values(2)[1:]
time_start = []
for i in data_current:
index = data_current.index(i)
if float(i) < 0.1 and float(data_current[index+1]) > 1:
print('come on!')
else:
print('a')
data_current = ['0.0', '0.0', '1.44']
这只是一个例子,但真实数据遵循相同的结构。
为什么我的输出始终为a
,而从来没有come on!
?
非常感谢! – cwl