我正在分析excel电子表格,需要找到包含最接近但小于500的值的单元格。我相信我已经实现了这一点,但需要知道相应的标题名称,我无法确定如何操作
loc=("/Volumes/Project/Andes_Glacier_Inventory.xlsx")
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(1)
headers = sheet.row(0)
print(sheet.row_values(1,3))
a = np.array(sheet.row_values(1,3))
value = 501
print (a[a<value].max())
使用
np.argmax
:相关问题 更多 >
编程相关推荐