use python Delete one excel Empty sub table in , It can be changed flexibly , Meet your personal needs
import openpyxl
# File path
workbook = './data/ New data collation / Beijing and Shanghai .xlsx'
# The main function
if __name__ == "__main__":
wb = openpyxl.load_workbook(workbook)
sheet = []
for sheetlist in wb:
# print("sheetTitle:", sheetlist.title)
if sheetlist.max_row == 1:
print(" Delete child table :", sheetlist.title)
wb.remove_sheet(sheetlist)
continue
sheet.append(sheetlist.title)
print(sheet)
print(len(sheet))
wb.save(workbook) # Remember to save