import pandas as pd
import xlwings as xw
import xlrd
PATH = r'C:\Users\user2\Desktop\Supplier Database.xlsx'
wb = xw.Book(PATH)
data = pd.read_excel(r"C:\Users\user2\Desktop\Supplier Database.xlsx")
data.sort_values("Weightpertrip(kg)", axis = 0, ascending = False,
inplace = True,)
array=[]
for i in range(2,12):
array.append([data.cell(i,10).value])
print(array)
在不使用数据框的情况下,我们可以在Python中对Excel的特定列进行排序