我一直在尝试为 xlwings 所需的语法寻找一个好的资源,但没有成功。我正在尝试制作一个程序,该程序将重复 n 行数据并将某些信息输出到新工作表。这是算法的一个片段。如果你能给我指一个好的参考或只是伸出援助之手,我将不胜感激。
data = number of rows in worksheet #either input the number manually or automate
for row n to data: #start at row 1 and loop through each line of data
axles = get row n, column M data #retrieve data in column M
if axles<2: #Test the data from column M for validity
continue #return to the for loop and start on next line
distance = get row n, column Q data #retrieve data in column Q
if distance < 100 or distance > 300: #test the data from column Q for validity
continue #return to the for loop and start on next line
weight = get row n, column P data #retrieve data in column P
print weight into row n, column A on sheet 2 #display output on a new sheet