我一直在試圖找到一個很好的xlwings所需的語法資源,並已成功。我正在嘗試製作一個程序,該程序將重複n行數據並將某些信息輸出到新工作表。這是算法的一個片段。如果你能指點我一個很好的參考或者只是伸出援手,我會很感激。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