I want to sort the excel file worksheet called "LTE_PrbUtil" and it has a column called "CELL" which is string descending. When I run the program and find some error:
File "C:\Users\p4532\Desktop\QGIS_project\highloading.py", line 18, in <module> df = df.sort(columns="CELL")
File "C:\Python27\lib\site-packages\pandas\core\generic.py", line 3081, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'sort'`
Here is my code:
import shutil
import pandas as pd
import xlrd
xl=pd.ExcelFile("C:\Users\p4532\Desktop\QGIS_project\HighUtilCells_new.xlsx")
df = xl.parse("LTE_PrbUtil")
df = df.sort(columns="CELL")
It seems the dataframe cannot recognize sort
.
Can anyone help?